Skip to content

Commit

Permalink
Fix: decoded JWT being null
Browse files Browse the repository at this point in the history
  • Loading branch information
Amruth-Vamshi committed Dec 5, 2024
1 parent 2fb5b6b commit fd0773a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/api/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,9 +776,12 @@ export class ApiService {

async verifyJWT(token:string): Promise<any> {
const { isValidFusionAuthToken, claims} = await this.verifyFusionAuthJWT(token);
let existingUserJWTS:any="[]"

let existingUserJWTS:any = JSON.parse(await this.redis.get(claims.sub));

if(claims?.sub) {
existingUserJWTS = JSON.parse(await this.redis.get(claims.sub));
}

if(!isValidFusionAuthToken){
if(existingUserJWTS.indexOf(token)!=-1){
existingUserJWTS.splice(existingUserJWTS.indexOf(token), 1);
Expand Down

0 comments on commit fd0773a

Please sign in to comment.