mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 16:16:55 +00:00
tRPC Endpoint를 /api/trpc로 변경
This commit is contained in:
@@ -4,7 +4,7 @@ import { authenticate, AuthenticationError } from "$lib/server/modules/auth";
|
||||
|
||||
export const authenticateMiddleware: Handle = async ({ event, resolve }) => {
|
||||
const { pathname, search } = event.url;
|
||||
if (pathname === "/api/auth/login" || pathname.startsWith("/trpc")) {
|
||||
if (pathname === "/api/auth/login") {
|
||||
return await resolve(event);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ export const authenticateMiddleware: Handle = async ({ event, resolve }) => {
|
||||
});
|
||||
} catch (e) {
|
||||
if (e instanceof AuthenticationError) {
|
||||
if (pathname === "/auth/login") {
|
||||
if (pathname === "/auth/login" || pathname.startsWith("/api/trpc")) {
|
||||
return await resolve(event);
|
||||
} else if (pathname.startsWith("/api")) {
|
||||
error(e.status, e.message);
|
||||
|
||||
Reference in New Issue
Block a user