🎨 (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:
2025-06-24 16:45:39 +07:00
parent 5469fd7ab3
commit ba6935c31b
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}
};