Skip to content

launch code cleanup - #81

Closed
rue-22 wants to merge 28 commits into
up-csi:mainfrom
rue-22:code-cleanup
Closed

launch code cleanup#81
rue-22 wants to merge 28 commits into
up-csi:mainfrom
rue-22:code-cleanup

Conversation

@rue-22

@rue-22 rue-22 commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

tm-cj-salces and others added 28 commits March 19, 2026 20:05
Add project guidance for Claude Code, a detailed implementation plan
for the admin role system, and simplified data flow diagrams.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- requireAuth(), requireRole(), isAdmin() utilities in lib/server/auth.ts
- Service-role Supabase client in lib/server/supabaseAdmin.ts (bypasses RLS)
- AppRole type includes applicant, admin, withdrawn, inactive

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The PUBLIC_ prefix exposes the service key to the browser in SvelteKit.
Renamed to SUPABASE_SERVICE_KEY and moved to secrets in deploy workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Part of Phase 3 — needed for auth helpers to type-check correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add both to .gitignore. Files kept locally but not in the repo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Implement authGuard that resolves user role from profiles table
  and attaches it to event.locals on every request
- Pass userRole through layout server load to page data
- Secure /api/get_gdrive_folder and /api/upload with session-based
  auth checks, replacing browser Supabase singleton with locals.supabase

Made-with: Cursor
Sort imports alphabetically, use object destructuring for locals,
and fix require-atomic-updates race conditions in authGuard hook.

Made-with: Cursor
@rue-22 rue-22 closed this Mar 20, 2026
@rue-22
rue-22 deleted the code-cleanup branch March 20, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants