mirror of https://github.com/laurent22/joplin.git
Server: Fixes #5958: Fixed sharing notebook with a user that does not have E2EE enabled
parent
9dbf5e02eb
commit
b92c650f5d
|
@ -10,6 +10,12 @@
|
||||||
|
|
||||||
# ./runForTesting.sh 1 createUsers,createData,reset,e2ee,sync && ./runForTesting.sh 2 reset,e2ee,sync && ./runForTesting.sh 1
|
# ./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:
|
# Without E2EE:
|
||||||
# ----------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------
|
||||||
|
|
|
@ -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
|
if (!user) return ''; // Don't throw an error to prevent polling the end point
|
||||||
|
|
||||||
const ppk = await ctx.joplin.models.user().publicPrivateKey(user.id);
|
const ppk = await ctx.joplin.models.user().publicPrivateKey(user.id);
|
||||||
|
if (!ppk) return '';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: ppk.id,
|
id: ppk.id,
|
||||||
|
|
Loading…
Reference in New Issue