mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 16:16:55 +00:00
비밀번호 변경 페이지 구현
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { error, text } from "@sveltejs/kit";
|
||||
import { authorize } from "$lib/server/modules/auth";
|
||||
import { changePasswordRequest } from "$lib/server/schemas";
|
||||
import { passwordChangeRequest } from "$lib/server/schemas";
|
||||
import { changePassword } from "$lib/server/services/auth";
|
||||
import type { RequestHandler } from "./$types";
|
||||
|
||||
export const POST: RequestHandler = async ({ locals, request }) => {
|
||||
const { sessionId, userId } = await authorize(locals, "any");
|
||||
|
||||
const zodRes = changePasswordRequest.safeParse(await request.json());
|
||||
const zodRes = passwordChangeRequest.safeParse(await request.json());
|
||||
if (!zodRes.success) error(400, "Invalid request body");
|
||||
const { oldPassword, newPassword } = zodRes.data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user