christensenjo / grimoire

A universal worldbuilding tool. Create unique settings, locations, and characters. Manage all your fantasy assets in a single modern application.
https://my-grimoire.com
0 stars 0 forks source link

Sign up email link doesn't verify email #14

Closed christensenjo closed 1 month ago

christensenjo commented 2 months ago
  1. Click 'Get Started'
  2. Add account details to form
  3. Click 'Create an Account'
  4. Current page changes to "We sent you an email"
  5. In mail client, click "Confirm your email"
  6. Opens new tab to login
  7. At some point, a 400 error is thrown by Supabase auth (probably on the new tab's sign in attempt) because there was no API key in the request to supabase
{
"message": "No API key found in request",
"hint": "No `apikey` request header or url param was found."
}
christensenjo commented 2 months ago

When they press the Confirm your Email button in the email, it should:

christensenjo commented 2 months ago

When I press Create an Account the signUp method is called, sends the supabase request to login, saves the response to the userStore, and logs the following: User account created, signed in, and data saved to user store -- signUp.vue 27 Then we are redirected to the confirmation page

The user watcher does confirmation page load logs the following when I press "Create an Account".

confirm.vue:11 cookieName:  sb                                                -- confirm.vue 11
confirm.vue:12 redirectPath:  undefined                                    -- confirm.vue 12
christensenjo commented 2 months ago

What's the value saved to the userStore from signup.vue::27?

christensenjo commented 2 months ago

I think the issue here has to do with the configuration in Supabase of the authentication email. I believe that the .ConfirmationEmail was originally doing two things: 1) Opening a new tab that I didn't want opened 2) Authenticating the user such that the previous /confirm page redirects the dashboard page

Now that I've changed the email template to use the SiteURL instead of the ConfirmationURL, it opening the right new tab (/email-confirmed), but it doesn't actually verify the authentication.

I am going to try to revert back to using the .ConfirmationURL

christensenjo commented 1 month ago

Got it working! Needed Cursor's help verifying token hash and SMTP server to get past rate limiting issues