mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 15:08:46 +00:00
비밀번호 변경 페이지 구현
This commit is contained in:
@@ -3,15 +3,16 @@
|
||||
import type { SvelteHTMLElements } from "svelte/elements";
|
||||
|
||||
interface Props {
|
||||
icon?: Component<SvelteHTMLElements["svg"]>;
|
||||
children: Snippet;
|
||||
icon?: Component<SvelteHTMLElements["svg"]>;
|
||||
topPadding?: boolean;
|
||||
}
|
||||
|
||||
let { icon: Icon, children }: Props = $props();
|
||||
let { topPadding = true, children, icon: Icon }: Props = $props();
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<div class="box-content flex min-h-[10vh] items-center pt-4">
|
||||
<div class="box-content flex min-h-[10vh] items-center {topPadding ? 'pt-4' : ''}">
|
||||
{#if Icon}
|
||||
<Icon class="text-5xl text-gray-600" />
|
||||
{/if}
|
||||
|
||||
@@ -41,8 +41,8 @@ export const refreshSession = async (
|
||||
.update(session)
|
||||
.set({
|
||||
lastUsedAt: now,
|
||||
lastUsedByIp: ip,
|
||||
lastUsedByUserAgent: userAgent,
|
||||
lastUsedByIp: ip ?? undefined,
|
||||
lastUsedByUserAgent: userAgent ?? undefined,
|
||||
})
|
||||
.where(
|
||||
and(
|
||||
|
||||
@@ -5,12 +5,12 @@ export const setAgentInfoMiddleware: Handle = async ({ event, resolve }) => {
|
||||
const userAgent = event.request.headers.get("User-Agent");
|
||||
if (!ip) {
|
||||
error(500, "IP address not found");
|
||||
} else if (!userAgent) {
|
||||
} else if (!userAgent && !event.isSubRequest) {
|
||||
error(400, "User agent not found");
|
||||
}
|
||||
|
||||
event.locals.ip = ip;
|
||||
event.locals.userAgent = userAgent;
|
||||
event.locals.userAgent = userAgent ?? "";
|
||||
|
||||
return await resolve(event);
|
||||
};
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const changePasswordRequest = z.object({
|
||||
export const passwordChangeRequest = z.object({
|
||||
oldPassword: z.string().trim().nonempty(),
|
||||
newPassword: z.string().trim().nonempty(),
|
||||
});
|
||||
export type ChangePasswordRequest = z.infer<typeof changePasswordRequest>;
|
||||
export type PasswordChangeRequest = z.infer<typeof passwordChangeRequest>;
|
||||
|
||||
export const loginRequest = z.object({
|
||||
email: z.string().email().nonempty(),
|
||||
|
||||
Reference in New Issue
Block a user