프론트엔드에서 세션 ID 기반 인증 대응 및 DB 마이그레이션 스크립트 재생성

This commit is contained in:
static
2025-01-12 08:31:11 +09:00
parent be8587694e
commit 85ebb529ba
14 changed files with 141 additions and 155 deletions

View File

@@ -1,11 +1,10 @@
import { redirect } from "@sveltejs/kit";
import type { PageServerLoad } from "./$types";
export const load: PageServerLoad = async ({ url, cookies }) => {
export const load: PageServerLoad = async ({ locals, url }) => {
const redirectPath = url.searchParams.get("redirect") || "/home";
const accessToken = cookies.get("accessToken");
if (accessToken) {
if (locals.session) {
redirect(302, redirectPath);
}