Skip to content

Commit

Permalink
Merge pull request #2631 from karelhala/no-double-auth
Browse files Browse the repository at this point in the history
Add check not to append Auth header if already present
  • Loading branch information
Hyperkid123 authored Sep 5, 2023
2 parents 35e56e6 + f1de4eb commit a289593
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 a289593

Please sign in to comment.