You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 27, 2026. It is now read-only.
src/app/contexts/AuthContext.tsx has 6 as unknown as type assertions that work around mismatches between Supabase Auth SDK types and the app's AuthUser type.
Severity
Medium — type safety gap, silent failures possible if Supabase SDK changes.
Locations
Line 111: supabase.rpc('is_admin', ...) as unknown as Promise<{...}>
Line 120: supabase.rpc('is_admin', ...) as unknown as Promise<{...}>
Line 135: (session.user as unknown as Record<string, unknown>).role as string
Line 149: (session.user as unknown as Record<string, unknown>).role as string
Line 169: session as unknown as { user: User | null }
Line 171: session as unknown as { user: User | null }
Recommended Fix
Create a typed Supabase helper in shared/api/ that wraps rpc() with proper generics.
Extend the AuthUser type to include role from Supabase user metadata.
Use a typed session wrapper instead of raw casting.
Summary
src/app/contexts/AuthContext.tsxhas 6as unknown astype assertions that work around mismatches between Supabase Auth SDK types and the app'sAuthUsertype.Severity
Medium — type safety gap, silent failures possible if Supabase SDK changes.
Locations
Recommended Fix
shared/api/that wrapsrpc()with proper generics.AuthUsertype to includerolefrom Supabase user metadata.Origin
Sprint Wave 15 Code Review, §2.2