🐛 fix: access cookie via header on logout
Some checks failed
Integration Tests / integration-tests (pull_request) Failing after 51s
Some checks failed
Integration Tests / integration-tests (pull_request) Failing after 51s
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
import { AppError } from "../../../../helpers/error/instances/app";
|
||||
import { ErrorForwarder } from "../../../../helpers/error/instances/forwarder";
|
||||
import { jwtDecode } from "../../../../helpers/http/jwt/decode";
|
||||
|
||||
export const tokenValidationService = (payload: string) => {
|
||||
try {
|
||||
if (!payload) return null;
|
||||
const decoded = jwtDecode(payload);
|
||||
return decoded;
|
||||
} catch (error) {
|
||||
throw new AppError(500, "Token validation failed", error);
|
||||
ErrorForwarder(error);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user