backend-common: TokenManager throws for invalid tokens rather than returning boolean

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
Mike Lewis
2021-11-23 17:16:57 +00:00
parent f38dff4085
commit 8a001f8202
7 changed files with 47 additions and 36 deletions
+2 -3
View File
@@ -95,9 +95,8 @@ async function main() {
req.cookies['token'];
// Authenticate all requests originating from backends by default
const isValidServerToken = await authEnv.tokenManager.validateServerToken(
token,
);
const isValidServerToken =
authEnv.tokenManager.validateServerToken(token);
if (!isValidServerToken) {
req.user = await identity.authenticate(token);
}