From ff399f94b65b9766e0af7509df03aeb86ff91a07 Mon Sep 17 00:00:00 2001 From: Justin Hiller Date: Thu, 14 Jan 2021 14:22:48 +0100 Subject: [PATCH] fix: mode not correctly set in refresh handler --- api/src/controllers/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/controllers/auth.ts b/api/src/controllers/auth.ts index d3ba990bae..e780fc069d 100644 --- a/api/src/controllers/auth.ts +++ b/api/src/controllers/auth.ts @@ -99,7 +99,7 @@ router.post( throw new InvalidPayloadException(`"refresh_token" is required in either the JSON payload or Cookie`); } - const mode: 'json' | 'cookie' = req.body.mode || req.body.refresh_token ? 'json' : 'cookie'; + const mode: 'json' | 'cookie' = req.body.mode || (req.body.refresh_token ? 'json' : 'cookie'); const { accessToken, refreshToken, expires } = await authenticationService.refresh(currentRefreshToken);