1
0
Fork 0
mirror of synced 2024-06-01 18:20:18 +12:00

Fix an issue with current app cookie, get rid of it on login/logout.

This commit is contained in:
mike12345567 2021-10-07 12:19:23 +01:00
parent e0b061a1db
commit e6844d7bdf

View file

@ -54,6 +54,8 @@ async function authInternal(ctx, user, err = null, info = null) {
// just store the user ID
ctx.cookies.set(Cookies.Auth, user.token, config)
// get rid of any app cookies on login
clearCookie(ctx, Cookies.CurrentApp)
}
exports.authenticate = async (ctx, next) => {
@ -117,6 +119,7 @@ exports.resetUpdate = async ctx => {
exports.logout = async ctx => {
clearCookie(ctx, Cookies.Auth)
clearCookie(ctx, Cookies.CurrentApp)
ctx.body = { message: "User logged out." }
}