🔒 security: add auth token validation via Redis and DB check

This commit is contained in:
2026-02-17 21:51:14 +07:00
parent 3122f34093
commit 9686153a82
4 changed files with 54 additions and 3 deletions

View File

@ -4,10 +4,10 @@ import { returnReadResponse } from "../../../helpers/callback/httpResponse";
import { mainErrorHandler } from "../../../helpers/error/handler";
import { parse } from "cookie";
export const tokenValidationController = (ctx: Context) => {
export const tokenValidationController = async (ctx: Context) => {
try {
const { auth_token } = parse(ctx.request.headers.get("cookie") || "");
const validationResult = tokenValidationService(auth_token as string);
const validationResult = await tokenValidationService(auth_token as string);
return returnReadResponse(
ctx.set,
200,