🎨 (jwt helper) create type and add details in error scope
create a type for JWT encode and add error details in JWT decode error scope
This commit is contained in:
@ -11,6 +11,6 @@ export const jwtDecode = (payload: string) => {
|
||||
const decodedPayload = jwt.verify(payload, JWTKey);
|
||||
return decodedPayload as JWTSessionPayload;
|
||||
} catch (error) {
|
||||
throw new AppError(401, "Invalid or expired token");
|
||||
throw new AppError(401, "Invalid or expired token", error);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user