Harden production auth for hackathon demo.

Configure Supabase redirect URLs, disable email confirmation on the remote
project, create profile and avatar rows on signup, and route new users to
/protected when a session is returned immediately.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-23 18:13:52 -06:00
parent 34c9dfa68b
commit f20c053db3
4 changed files with 46 additions and 7 deletions

View File

@@ -40,14 +40,18 @@ export function SignUpForm({
}
try {
const { error } = await supabase.auth.signUp({
const { data, error } = await supabase.auth.signUp({
email,
password,
options: {
emailRedirectTo: `${window.location.origin}/protected`,
emailRedirectTo: `${window.location.origin}/auth/confirm?next=/protected`,
},
});
if (error) throw error;
if (data.session) {
router.push("/protected");
return;
}
router.push("/auth/sign-up-success");
} catch (error: unknown) {
setError(error instanceof Error ? error.message : "An error occurred");