Adding a check for test environment to not clear app cookie on login as this breaks cypress.

This commit is contained in:
mike12345567 2021-10-07 17:39:44 +01:00
parent 52b44736c5
commit 4d04a3baf4
1 changed files with 4 additions and 1 deletions

View File

@ -55,7 +55,10 @@ async function authInternal(ctx, user, err = null, info = null) {
// just store the user ID // just store the user ID
ctx.cookies.set(Cookies.Auth, user.token, config) ctx.cookies.set(Cookies.Auth, user.token, config)
// get rid of any app cookies on login // get rid of any app cookies on login
// have to check test because this breaks cypress
if (!env.isTest()) {
clearCookie(ctx, Cookies.CurrentApp) clearCookie(ctx, Cookies.CurrentApp)
}
} }
exports.authenticate = async (ctx, next) => { exports.authenticate = async (ctx, next) => {