Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions client/functions/[[path]].ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ export async function onRequest(context: EventContext<Env, any, any>): Promise<R
const url = new URL(request.url);
const path = url.pathname;

// サービスにアクセスしたことがある場合、/home にリダイレクト
if (path === "/") {
const cookie = request.headers.get("cookie") ?? "";
if (cookie.includes("browserId=")) {
return Response.redirect(`${url.origin}/home`, 302);
}
}

// 静的アセットや API ルートは通常通り処理
if (
path.startsWith("/assets/") ||
Expand Down