mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-19 19:02:29 +08:00
fix: review-driven hardening — env guards, token expiry, slug validation, dashboard UX
From CEO plan review: - Edge functions: early guard on missing env vars instead of non-null assert crash - cli-team: wire isTokenExpired check (was imported but unused) - Migration 007: CHECK constraint on team slug (a-z0-9 hyphens, 2-50 chars) - Dashboard: streak badges on leaderboard, repo slug in who's-online, contextual empty states that teach, 60s refresh (was 30s) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -79,8 +79,12 @@ export function formatDigestMessage(data: DigestData): string {
|
||||
|
||||
Deno.serve(async (_req: Request) => {
|
||||
try {
|
||||
const supabaseUrl = Deno.env.get('SUPABASE_URL')!;
|
||||
const serviceKey = Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!;
|
||||
const supabaseUrl = Deno.env.get('SUPABASE_URL');
|
||||
const serviceKey = Deno.env.get('SUPABASE_SERVICE_ROLE_KEY');
|
||||
if (!supabaseUrl || !serviceKey) {
|
||||
console.error('Missing SUPABASE_URL or SUPABASE_SERVICE_ROLE_KEY env vars');
|
||||
return new Response('OK (missing env vars)', { status: 200 });
|
||||
}
|
||||
const supabase = createClient(supabaseUrl, serviceKey);
|
||||
|
||||
const weekAgo = new Date(Date.now() - 7 * 86_400_000).toISOString();
|
||||
|
||||
Reference in New Issue
Block a user