fix: mode not correctly set in refresh handler

This commit is contained in:
Justin Hiller
2021-01-14 14:22:48 +01:00
parent f05e264c85
commit ff399f94b6

View File

@@ -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);