👔 (user) create user check password

create boilerplate code for user check password
This commit is contained in:
unknown
2025-06-30 23:42:28 +07:00
parent 26295c749c
commit e7857e0384
4 changed files with 29 additions and 2 deletions

View File

@ -0,0 +1,12 @@
import { Context } from "elysia";
import { checkUserPasswordService } from "../services/checkUserPassword.service";
import { jwtDecode } from "../../../helpers/http/jwt/decode";
import { getCookie } from "../../../helpers/http/userHeader/cookies/getCookies";
export const checkUserPasswordController = async (
ctx: Context & { body: { password: string } }
) => {
const cookie = getCookie(ctx);
const jwtPayload = jwtDecode(cookie.auth_token!);
return checkUserPasswordService(jwtPayload, ctx.body.password);
};