1
0
Fork 0
mirror of synced 2024-07-04 22:11:23 +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 f6396649b5
commit fa2a958e73

View file

@ -141,7 +141,9 @@ exports.resetUpdate = async ctx => {
} }
exports.logout = 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." } ctx.body = { message: "User logged out." }
} }