Skip to content

Commit fd0773a

Browse files
committed
Fix: decoded JWT being null
1 parent 2fb5b6b commit fd0773a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/api/api.service.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -776,9 +776,12 @@ export class ApiService {
776776

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

780-
let existingUserJWTS:any = JSON.parse(await this.redis.get(claims.sub));
781-
781+
if(claims?.sub) {
782+
existingUserJWTS = JSON.parse(await this.redis.get(claims.sub));
783+
}
784+
782785
if(!isValidFusionAuthToken){
783786
if(existingUserJWTS.indexOf(token)!=-1){
784787
existingUserJWTS.splice(existingUserJWTS.indexOf(token), 1);

0 commit comments

Comments
 (0)