feat: add logout module

This commit is contained in:
2026-02-10 23:12:04 +07:00
parent e46711bf2f
commit 08125dcb11
4 changed files with 38 additions and 4 deletions

View File

@ -0,0 +1,14 @@
import { AppError } from "../../../../helpers/error/instances/app";
import { ErrorForwarder } from "../../../../helpers/error/instances/forwarder";
import { jwtDecode } from "../../../../helpers/http/jwt/decode";
export const logoutService = async (jwtToken?: any) => {
try {
if (!jwtToken) throw new AppError(403, "No auth token provided");
const jwtPayload = jwtDecode(jwtToken);
return jwtPayload;
} catch (error) {
ErrorForwarder(error);
}
};