Skip to content

Commit

Permalink
Add check not to append Auth header if already present
Browse files Browse the repository at this point in the history
  • Loading branch information
karelhala committed Sep 4, 2023
1 parent 35e56e6 commit f1de4eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/iqeEnablement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function init(store: Store, libJwt?: () => LibJWT | undefined) {
const tid = Math.random().toString(36);
const request: Request = new Request(input, init);

if (checkOrigin(input) && libJwt?.()?.jwt.isAuthenticated()) {
if (checkOrigin(input) && libJwt?.()?.jwt.isAuthenticated() && !request.headers.has('Authorization')) {
request.headers.append('Authorization', `Bearer ${libJwt?.()?.jwt.getEncodedToken()}`);
}

Expand Down

0 comments on commit f1de4eb

Please sign in to comment.