Skip to content

Commit

Permalink
fix: add replace for the JWT
Browse files Browse the repository at this point in the history
source : https://github.com/auth0/jwt-decode/blob/main/lib/index.ts#L38
If anyone encounters another error, we could add the other part (the switch case) to this library
  • Loading branch information
NonozgYtb authored Aug 25, 2024
1 parent 5a650e7 commit db35e93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ export class Skolengo {
*/
public getTokenClaims (): IdTokenClaims {
if (this.tokenSet.id_token === undefined) throw new TypeError('id_token not present in TokenSet')
return JSON.parse(atob((this.tokenSet.id_token).split('.')[1]))
return JSON.parse(atob((this.tokenSet.id_token).split('.')[1].replace(/-/g, "+").replace(/_/g, "/")))

Check failure on line 1060 in src/index.ts

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check failure on line 1060 in src/index.ts

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
}

/**
Expand Down

0 comments on commit db35e93

Please sign in to comment.