1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

Server: Fixes #5958: Fixed sharing notebook with a user that does not have E2EE enabled

This commit is contained in:
Laurent Cozic 2022-01-09 15:20:23 +00:00
parent 9dbf5e02eb
commit b92c650f5d
2 changed files with 7 additions and 0 deletions

View File

@ -10,6 +10,12 @@
# ./runForTesting.sh 1 createUsers,createData,reset,e2ee,sync && ./runForTesting.sh 2 reset,e2ee,sync && ./runForTesting.sh 1
# ----------------------------------------------------------------------------------
# First user has E2EE, but second one doesn't:
# ----------------------------------------------------------------------------------
# ./runForTesting.sh 1 createUsers,createData,reset,e2ee,sync && ./runForTesting.sh 2 reset,sync && ./runForTesting.sh 1
# ----------------------------------------------------------------------------------
# Without E2EE:
# ----------------------------------------------------------------------------------

View File

@ -34,6 +34,7 @@ router.get('api/users/:id/public_key', async (path: SubPath, ctx: AppContext) =>
if (!user) return ''; // Don't throw an error to prevent polling the end point
const ppk = await ctx.joplin.models.user().publicPrivateKey(user.id);
if (!ppk) return '';
return {
id: ppk.id,