Ship Steam login, D1 player sync, and cached「我」dashboard.
Players get a fast TTL-backed homepage (local profile / Cloudflare D1) with dense UI polish; login unlocks /home without blocking on every OpenDota refresh. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* GET /api/auth/steam — redirect to Steam OpenID login.
|
||||
*/
|
||||
import { envOf, steamLoginRedirectUrl } from "./_steam_common.js";
|
||||
|
||||
export async function onRequestGet(context) {
|
||||
const env = envOf(context);
|
||||
if (!(env.SESSION_SECRET || "").trim() || !(env.STEAM_API_KEY || "").trim()) {
|
||||
return new Response("Steam login not configured", { status: 503 });
|
||||
}
|
||||
const origin = new URL(context.request.url).origin;
|
||||
return Response.redirect(steamLoginRedirectUrl(origin), 302);
|
||||
}
|
||||
Reference in New Issue
Block a user