mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 16:16:55 +00:00
백엔드에서 JWT가 아닌 세션 ID 기반으로 인증하도록 변경
This commit is contained in:
@@ -5,8 +5,8 @@ import { fileInfoResponse, type FileInfoResponse } from "$lib/server/schemas";
|
||||
import { getFileInformation } from "$lib/server/services/file";
|
||||
import type { RequestHandler } from "./$types";
|
||||
|
||||
export const GET: RequestHandler = async ({ cookies, params }) => {
|
||||
const { userId } = await authorize(cookies, "activeClient");
|
||||
export const GET: RequestHandler = async ({ locals, params }) => {
|
||||
const { userId } = await authorize(locals, "activeClient");
|
||||
|
||||
const zodRes = z
|
||||
.object({
|
||||
|
||||
@@ -4,8 +4,8 @@ import { authorize } from "$lib/server/modules/auth";
|
||||
import { deleteFile } from "$lib/server/services/file";
|
||||
import type { RequestHandler } from "./$types";
|
||||
|
||||
export const POST: RequestHandler = async ({ cookies, params }) => {
|
||||
const { userId } = await authorize(cookies, "activeClient");
|
||||
export const POST: RequestHandler = async ({ locals, params }) => {
|
||||
const { userId } = await authorize(locals, "activeClient");
|
||||
|
||||
const zodRes = z
|
||||
.object({
|
||||
|
||||
@@ -4,8 +4,8 @@ import { authorize } from "$lib/server/modules/auth";
|
||||
import { getFileStream } from "$lib/server/services/file";
|
||||
import type { RequestHandler } from "./$types";
|
||||
|
||||
export const GET: RequestHandler = async ({ cookies, params }) => {
|
||||
const { userId } = await authorize(cookies, "activeClient");
|
||||
export const GET: RequestHandler = async ({ locals, params }) => {
|
||||
const { userId } = await authorize(locals, "activeClient");
|
||||
|
||||
const zodRes = z
|
||||
.object({
|
||||
|
||||
@@ -5,8 +5,8 @@ import { fileRenameRequest } from "$lib/server/schemas";
|
||||
import { renameFile } from "$lib/server/services/file";
|
||||
import type { RequestHandler } from "./$types";
|
||||
|
||||
export const POST: RequestHandler = async ({ request, cookies, params }) => {
|
||||
const { userId } = await authorize(cookies, "activeClient");
|
||||
export const POST: RequestHandler = async ({ locals, params, request }) => {
|
||||
const { userId } = await authorize(locals, "activeClient");
|
||||
|
||||
const paramsZodRes = z
|
||||
.object({
|
||||
|
||||
@@ -4,8 +4,8 @@ import { fileUploadRequest } from "$lib/server/schemas";
|
||||
import { uploadFile } from "$lib/server/services/file";
|
||||
import type { RequestHandler } from "./$types";
|
||||
|
||||
export const POST: RequestHandler = async ({ request, cookies }) => {
|
||||
const { userId } = await authorize(cookies, "activeClient");
|
||||
export const POST: RequestHandler = async ({ locals, request }) => {
|
||||
const { userId } = await authorize(locals, "activeClient");
|
||||
|
||||
const form = await request.formData();
|
||||
const metadata = form.get("metadata");
|
||||
|
||||
Reference in New Issue
Block a user