diff --git a/src/middleware.ts b/src/middleware.ts index 5e878a6..4d6e841 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -9,7 +9,7 @@ export function middleware(request: NextRequest) { if (pathname == "/") { if (playerIdCookie) { return NextResponse.redirect( - new URL(`/player/${playerIdCookie}`, request.url), + new URL(`/player/${playerIdCookie.value}`, request.url), ); } else { return NextResponse.redirect(new URL("/search", request.url)); diff --git a/src/store/settingsStore.ts b/src/store/settingsStore.ts index f11250e..b78f2d9 100644 --- a/src/store/settingsStore.ts +++ b/src/store/settingsStore.ts @@ -44,7 +44,9 @@ export const useSettingsStore = create()( player: playerData, }); - cookieCutter.set("playerId", playerData.id); + cookieCutter.set("playerId", playerData.id, { + path: "/", + }); }, async addFriend(friendId: string) {