dmayo2
"Deep linking" Why the disparity btn local & prod
If URLSearchParams is a browser API why not use the built-in resource? If I'm not importing, useSearchParams() then I'd be shipping a smaller app, and, theoretically, it'd be faster ? Or is it that useSearchParams() does the grunt work in the background by assigning variables? At my code's scale, is this 'to-may-to' / 'to-mah-to' instance?
6 replies
parent of nested routes
That link is only valid for 24 hours and is a one-time use. Somehow, that's getting hit simulatiously and thus when my code runs, it get's the expired link error. So, I'm trying to debug where it's getting hit twice.
22 replies
parent of nested routes
And the return is a hash to localhost:3000
This is the error:
localhost:3000#error=unauthorized_client&error_code=401&error_description=Email+link+is+invalid+or+has+expired
and a valid link with the token looks like:
22 replies
parent of nested routes
The link from Supabase is redirected to / or I've also tried /profile which is inside RouteGuard (but so is /). This is the "magic login link"
https://yrgprjcjvq.supabase.co/auth/v1/verify?token=abc1dc85df42f343608abac3295a67232&type=magiclink&redirect_to=http://localhost:3000
22 replies
parent of nested routes
The login is a form in /login which is outside of RouteGuard. Supabase has a js client that you submit to. It checks the email against Auth.users. If it finds it, it responds with Ok, and sends an email with a link that contains a token that sets the session.
The session logic is in RouteGuard:
22 replies
parent of nested routes
I guess I'll try to rename it to /home or /dashboard.
My issue is that the supabase emailed login link is being hit once before the user hits it (micro seconds) so the link becomes invalid after one use.
It was working fine before I nested routes. I had ternary logic for routes, but that wasn't working correctly, then I realized I could simplify the code with nested routes, but that has resulted in the double hit, so I can't log in.
22 replies