1
0
Fork 0
mirror of synced 2024-06-14 00:14:39 +12:00

Fix server crash when trying to log out and already logged out

This commit is contained in:
Andrew Kingston 2022-01-19 11:22:44 +00:00
parent 8b976bed52
commit 4e7d5e7d65

View file

@ -141,7 +141,9 @@ exports.resetUpdate = async ctx => {
}
exports.logout = async ctx => {
await platformLogout({ ctx, userId: ctx.user._id })
if (ctx.user && ctx.user._id) {
await platformLogout({ ctx, userId: ctx.user._id })
}
ctx.body = { message: "User logged out." }
}