From e6844d7bdfa28dada18f718460e1a6d9aa0a236d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Oct 2021 12:19:23 +0100 Subject: [PATCH] Fix an issue with current app cookie, get rid of it on login/logout. --- packages/worker/src/api/controllers/global/auth.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/worker/src/api/controllers/global/auth.js b/packages/worker/src/api/controllers/global/auth.js index 4e5603b596..76768d1700 100644 --- a/packages/worker/src/api/controllers/global/auth.js +++ b/packages/worker/src/api/controllers/global/auth.js @@ -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." } }