Skip to content

Commit

Permalink
fix: anonymous allow fix for authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
drodil committed Jan 17, 2024
1 parent d69ad12 commit ae9948a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/qeta-backend/src/service/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,19 @@ export const getUsername = async (
req.header('authorization'),
);
if (token) {
await options.tokenManager.authenticate(token);
return '';
try {
await options.tokenManager.authenticate(token);
return '';
} catch (e) {
// NOOP
}
}
}

const allowAnonymous = options.config.getOptionalBoolean(
'qeta.allowAnonymous',
);

if (allowAnonymous) {
return 'user:default/guest';
}
Expand Down

0 comments on commit ae9948a

Please sign in to comment.