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
1 changed files with 3 additions and 1 deletions

View File

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