How to create a user email authentication process

Any tutorials out there on how to create a user email authentication process (using magic links or otherwise) for Xano/Weweb? I have my password reset flow working well but the user email authentication flow seems a little more involved. Thanks.

Hi @chocpretz :wave:

Nice! The password reset flow is usually the hardest to set up so well done :raised_hands:

Here are a couple of resources that might help for the rest:

You’ve probably seen that second one because the example uses a forgot password flow but similar logic would apply for a sign in :slight_smile:

We’re planning to re-write the Xano auth article this month so if you have any feedback / improvement suggestions, don’t hesitate to let us know!

+1 I’m stuck on this as well @Joyce and the current magic link instructions seem like they’re missing a step or something. Working on magic link login right now, and the magic-login API endpoint returns an auth token, but how do we set it as the Xano Auth user token in WeWeb and trigger the actual login?

I managed it with a page on load workflow: First get the MagicLink verified, then Modify the Xano Auth Access Token and Related Cookie and then Fetch the user again:

I got the tips from this post:

Rgds.
Pat

1 Like

Thanks for sharing @plucky00!

@elyseholladay, since that thread, we added the Store token action in the Xano auth plugin so you should be able to replace the Custom Javascript step with the Store token action.

You’ll need to test the Request action first, then you can bind the result from the Request step in the Store token step

For anyone struggling with this and isn’t afraid of SQL, give Supabase a try. Their auth system / Weweb’s plugin is much more user friendly than Xano (except for the row level security policies).

1 Like

ahh @plucky00 thank you, the step I was missing was re-fetching the user. @Joyce I had found the store token step, but hadn’t figured out what to do next. got it working! thanks for the help, y’all! next up, reset password. looking forward to updated docs on this :blush:

not sure if this is weweb or xano related (or both), but: I had to put my xano magic_link_redirect_uri as https://mysite.weweb-preview.io?token= and include the ?token= bit, or it wouldn’t work correctly.

it seemed like it was working while I was testing, but now I am seeing that my magic link uri is https://mysite.weweb-preview.io/resetpassword?token= but when it gets generated there’s an extra slash: resetpassword/?token= and so it’s failing :woman_shrugging:t3: any thoughts are welcome

in addition, it fails if i make the url mysite.weweb-preview.io/login – weweb seems to 404 on that, I get a browser 404 that that page doesn’t exist. I assume this is because /login is set as my homepage? ideally you could also go directly to a /login URL.

This.

@Broberto @chocpretz I really like Supabase, and I’ve used it; there are reasons a person might pick Xano over Supabase though, and each one has pros and cons :slight_smile: