Merge pull request #657 from mirumee/fix/no-permissions-err
Fix Value PermissionDenied not found in enum
This commit is contained in:
commit
ea40c8dff1
1 changed files with 8 additions and 1 deletions
|
@ -8,7 +8,14 @@ export enum JWTError {
|
|||
}
|
||||
|
||||
export function isJwtError(error: GraphQLError): boolean {
|
||||
return !!findValueInEnum(error.extensions.exception.code, JWTError);
|
||||
let jwtError: boolean;
|
||||
try {
|
||||
jwtError = !!findValueInEnum(error.extensions.exception.code, JWTError);
|
||||
} catch (e) {
|
||||
jwtError = false;
|
||||
}
|
||||
|
||||
return jwtError;
|
||||
}
|
||||
|
||||
export function isTokenExpired(error: GraphQLError): boolean {
|
||||
|
|
Loading…
Reference in a new issue