From 4d04a3baf400bb392c4ec1440dd48e7f7c7574f9 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Oct 2021 17:39:44 +0100 Subject: [PATCH] Adding a check for test environment to not clear app cookie on login as this breaks cypress. --- packages/worker/src/api/controllers/global/auth.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/worker/src/api/controllers/global/auth.js b/packages/worker/src/api/controllers/global/auth.js index 76768d1700..9d7df7ca37 100644 --- a/packages/worker/src/api/controllers/global/auth.js +++ b/packages/worker/src/api/controllers/global/auth.js @@ -55,7 +55,10 @@ 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) + // have to check test because this breaks cypress + if (!env.isTest()) { + clearCookie(ctx, Cookies.CurrentApp) + } } exports.authenticate = async (ctx, next) => {