# How to create a user email authentication process

**URL:** <https://community.weweb.io/t/how-to-create-a-user-email-authentication-process/4134>\
**Category:** How do I?\
**Tags:** authentication, xano\
**Created:** [August 31, 2023, 5:38pm UTC](https://community.weweb.io/t/how-to-create-a-user-email-authentication-process/4134 "2023-08-31T17:38:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![chocpretz](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@chocpretz](https://community.weweb.io/u/chocpretz)\
**Post date:** [August 31, 2023, 5:38pm UTC](https://community.weweb.io/t/how-to-create-a-user-email-authentication-process/4134/1 "2023-08-31T17:38:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [September 1, 2023, 9:37am UTC](https://community.weweb.io/t/how-to-create-a-user-email-authentication-process/4134/2 "2023-09-01T09:37:28Z")

</div>

Hi @chocpretz 👋

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

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

- for [simple email + password user signup and login with Xano and WeWeb](https://docs.weweb.io/plugins/auth-systems/xano-auth.html#sign-up-and-log-in-flows)
- to setup a [magic link auth system with Xano / Sendgrid / WeWeb](https://docs.weweb.io/plugins/auth-systems/xano-auth.html#forgot-password-with-xano-auth).

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

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!

---

<div class="post-metadata">

**Author:** ![elyseholladay](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/elyseholladay/32/3921_2.png) [@elyseholladay](https://community.weweb.io/u/elyseholladay)\
**Post date:** [September 7, 2023, 1:37am UTC](https://community.weweb.io/t/how-to-create-a-user-email-authentication-process/4134/3 "2023-09-07T01:37:38Z")

</div>

+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?

---

<div class="post-metadata">

**Author:** ![plucky00](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/plucky00/32/4726_2.png) [@plucky00](https://community.weweb.io/u/plucky00)\
**Post date:** [September 7, 2023, 11:22am UTC](https://community.weweb.io/t/how-to-create-a-user-email-authentication-process/4134/4 "2023-09-07T11:22:45Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/1/1ee1a7672a27241a9a99f398d80672e3fc8dfb6b.png)

I got the tips from this post:

> [@Login with authToken (MagicLink)](https://community.weweb.io/t/login-with-authtoken-magiclink/775):
>
> @aurelie @Joyce (Just moving this here to get into the right thread) I have an endpoint that returns an authToken. I’d like to login the user on WeWeb at that point. Currently, no action exists to login to WeWeb front end with an authToken. I have the following set up: variables[/\* xanoAuth accessToken \*/ 'f58 ... 4e1-accessToken'] = context.workflow['536 ... c8f6'].result['auth\_token'] window.vm.config.globalProperties.$cookie.setCookie("ww-auth-access-token", context.workflow['536 ... c8f6…

Rgds.  
Pat

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [September 7, 2023, 3:09pm UTC](https://community.weweb.io/t/how-to-create-a-user-email-authentication-process/4134/5 "2023-09-07T15:09:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chocpretz](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@chocpretz](https://community.weweb.io/u/chocpretz)\
**Post date:** [September 7, 2023, 3:39pm UTC](https://community.weweb.io/t/how-to-create-a-user-email-authentication-process/4134/6 "2023-09-07T15:39:49Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![elyseholladay](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/elyseholladay/32/3921_2.png) [@elyseholladay](https://community.weweb.io/u/elyseholladay)\
**Post date:** [September 7, 2023, 9:36pm UTC](https://community.weweb.io/t/how-to-create-a-user-email-authentication-process/4134/7 "2023-09-07T21:36:36Z")

</div>

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 😊

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 🤷🏼‍♀️ 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.

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [September 7, 2023, 9:51pm UTC](https://community.weweb.io/t/how-to-create-a-user-email-authentication-process/4134/8 "2023-09-07T21:51:06Z")

</div>

> [@chocpretz](#):
>
> 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).

This.

---

<div class="post-metadata">

**Author:** ![elyseholladay](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/elyseholladay/32/3921_2.png) [@elyseholladay](https://community.weweb.io/u/elyseholladay)\
**Post date:** [September 8, 2023, 12:40am UTC](https://community.weweb.io/t/how-to-create-a-user-email-authentication-process/4134/9 "2023-09-08T00:40:38Z")

</div>

@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 🙂
