Fix Value PermissionDenied not found in enum

This commit is contained in:
dominik-zeglen 2020-08-18 17:20:06 +02:00
parent e57c081cce
commit 7849ebf3f9

View file

@ -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 {