Skip to content

Conversation

MaxBroome
Copy link
Contributor

Improved the sign-up page with a couple of little tweaks 😉

  1. If sign-ups were disabled in Supabase I added a specific alert box for that, rather than the form throwing a generic error to the user. That ways an admin can disable sign-ups directly in the DB if they have too much demand; and users know to come back later.
  2. When signing up, after a user enters their desired email and password, the page automatically tried to forward them to the dashboard, however most Supabase instances have email verification first before a user is allowed to sign-in. So this would fail and just redirect them to the login page with no messages (a very similar looking page, and some users might even think that they are trying to sign-up again as it failed.).

However even though I didn't implement it, if some people want to disable email verification then this would be confusing. I just realized this after I submitted this PR. Maybe an option to say if they have verification enabled or disabled could be in order; but that's a later task.

  1. Small fix but 'Email' was misspelled as 'Emial' on both forms. 😄

@kizivat kizivat self-requested a review March 25, 2025 10:31
search.set('next', event.url.searchParams.get('next') || '/dashboard');

redirect(303, '/auth/callback?' + search.toString());
// Instead of redirecting, return success status and the email used to sign up
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can check if session returned from signUp is non-null. If so, we can still redirect.

@kizivat
Copy link
Owner

kizivat commented Mar 25, 2025

Thank you @MaxBroome, that is a very good point!

I fixed the issue with disabled email verification as well (the signUp() method returns non-null session right away then).

I wanted to add it to this PR as I see you've allowed edits from maintainers, but somehow my push to your fork still fails, so I'll add it afterwards. Feel free to check it out then. :)

@kizivat kizivat merged commit 8a7a9d8 into kizivat:main Mar 25, 2025
3 of 4 checks passed
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.

2 participants