add custom confirm sign up page where user can click on a button to verify their email
redirect user to 404 page for any improper access to verify and confirm-signup page
Implementation
Certain email providers may prefetch URL links from incoming emails as part of a security feature. In this case, the confirmation url link sent by Supabase to the use will be consumed instantly, which leads to a "Token has expired or is invalid" error. To mitigate this, we have chosen to create a custom email link to redirect the user to a custom confirm sign up page. This implementation will require the user to actually clicks on the confirm sign up button to verify their identities.
Refer supabase doc for more details
For error handling, we are now redirecting user to not-found page if user tries to access the page by manipulating the urls directly
For resend email function in supabase, I have enabled the function to accept ResendType as to make the function more generic (so that in the case where we need it for email_change in the future, we can reuse the function)
Testing
To set up the project locally for testing, follow the following steps:
Install dependencies
yarn install
Run the development server
yarn dev
Head over to user sign up page
Fill in valid school emails and password
If account creation is successful, you should be redirected to email verification page
Check your inbox for the supabase email verification link
Once you click on the link, you should be redirected to sign up confirmation page
Click on the Confirm Sign Up button and you should be redirected to log in page
Log in using the credentials used in step 5, and click on log in button
You should be able to see AfterClass' homepage successfully
Closes #12
Changes
confirm sign up
page where user can click on a button to verify their emailverify
andconfirm-signup
pageImplementation
confirm sign up page
. This implementation will require the user to actually clicks on theconfirm sign up
button to verify their identities. Refer supabase doc for more detailsnot-found
page if user tries to access the page by manipulating the urls directlyResendType
as to make the function more generic (so that in the case where we need it foremail_change
in the future, we can reuse the function)Testing
To set up the project locally for testing, follow the following steps:
yarn install
yarn dev
Confirm Sign Up
button and you should be redirected to log in pagePreview