fix: Supabase RLS, storage, auth, and week cycle bugs - #53
Draft
SaharPak wants to merge 1 commit into
Draft
Conversation
Database (migrations 004–006): - Add product-images storage bucket with per-user upload policies - Let builders read own hidden products; expose demo archive products - Restrict votes/comments to live products; cap profile bio length - Align current_week() SQL with Sat–Fri Helsinki submission cycle App fixes: - Fix auth callback overwriting onboarding redirect on Cloudflare - Block open redirects; enforce onboarding until handle is set - Fix weekend week_of roll-forward; sync Friday demo date picker - Require demo_week for live demos; remove silent migration fallback - Cron and admin snapshot error handling; refresh demo days list - Use getUser() on server; show vote errors; safe JSON parse for builder - Owners can view hidden products; build without Supabase env vars Co-authored-by: Sahar <SaharPak@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes production bugs across Supabase (RLS, storage, week logic) and the Next.js app (auth, validation, error handling).
Database migrations (run in Supabase SQL Editor)
004_storage_product_images.sqlproducts/{user_id}/…005_rls_fixes.sql006_current_week_cycle.sqlcurrent_week()matches Sat–Fri Helsinki cycle (same as app)App fixes
getUser()instead ofgetSession(); vote errors shown to usersHow to apply