# Login with authToken (MagicLink)

**URL:** <https://community.weweb.io/t/login-with-authtoken-magiclink/775>\
**Category:** How do I?\
**Created:** [July 12, 2022, 8:37pm UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775 "2022-07-12T20:37:51Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![clncsports](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@clncsports](https://community.weweb.io/u/clncsports)\
**Post date:** [January 18, 2023, 8:29pm UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/21 "2023-01-18T20:29:16Z")

</div>

Thanks for this everyone, especially @kevinwasie 😊 I was able to get the javascript to successfully set the token in the plugin.

However I’m facing an error upon running the fetch user action. Wondering if anyone else ran into this.

After running the JS, I see the token properly set:

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

When I then run the Fetch User action I receive this 400:

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

Additionally, after the fetch user action fails, the token variable gets nulled out:  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/478a3b19025468b4ce1f6f0e1bbae5ea6257e55d.png)

🤔

P.S. I’m actually not doing this for the sake of magic link - I’m doing it because the actual xano login action appears to be broken so I’ve resorted to using a request action to hit my login endpoint

---

<div class="post-metadata">

**Author:** ![clncsports](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@clncsports](https://community.weweb.io/u/clncsports)\
**Post date:** [January 18, 2023, 8:40pm UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/22 "2023-01-18T20:40:12Z")

</div>

False alarm! Was a small misconfiguration in my get/me endpoint. Fixed and now have the plugin fully populated with user data.

Many thanks!

---

<div class="post-metadata">

**Author:** ![Alexis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/alexis/32/13248_2.png) [@Alexis](https://community.weweb.io/u/Alexis)\
**Post date:** [January 19, 2023, 10:03am UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/23 "2023-01-19T10:03:07Z")

</div>

Can you give another try with the xano auth social login as you fixed your endpoint configuration ?

---

<div class="post-metadata">

**Author:** ![MichaelLovell](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/michaellovell/32/2157_2.png) [@MichaelLovell](https://community.weweb.io/u/MichaelLovell)\
**Post date:** [March 16, 2023, 2:19am UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/24 "2023-03-16T02:19:37Z")

</div>

noob question.

Where do I find the id for the context.workflow reference?

> [@kevinwasie](#):
>
> `context.workflow['536 ... c8f6'].result['auth_token']`

---

<div class="post-metadata">

**Author:** ![Alexis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/alexis/32/13248_2.png) [@Alexis](https://community.weweb.io/u/Alexis)\
**Post date:** [March 16, 2023, 1:58pm UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/25 "2023-03-16T13:58:01Z")

</div>

Hi, you can use the custom javascript action, click on the result variable, it will add it on your javascript function

 ![Capture d’écran 2023-03-16 à 14.55.45](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/f/fc1a5d682d028af9a116ad0727554a980462106d.png)

But you can use any action requiring a formula and turn on the javascript mode for the same result.

---

<div class="post-metadata">

**Author:** ![MichaelLovell](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/michaellovell/32/2157_2.png) [@MichaelLovell](https://community.weweb.io/u/MichaelLovell)\
**Post date:** [March 16, 2023, 7:43pm UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/26 "2023-03-16T19:43:19Z")

</div>

Thank you @Alexis! I knew it was going to be something simple that I overlooked.

Appreciate the help. 🙌

---

<div class="post-metadata">

**Author:** ![Ran](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@Ran](https://community.weweb.io/u/Ran)\
**Post date:** [July 6, 2023, 2:26pm UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/27 "2023-07-06T14:26:41Z")

</div>

Hi Kevin,  
Having the same issue…  
Even after implimanting the JS it dosen’t change the xano auth access token.  
Any suggestions?  
Thanks in advance

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

---

<div class="post-metadata">

**Author:** ![Alexis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/alexis/32/13248_2.png) [@Alexis](https://community.weweb.io/u/Alexis)\
**Post date:** [July 6, 2023, 2:33pm UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/28 "2023-07-06T14:33:57Z")

</div>

Do you have the Xano Auth plugin installed ?

Do you really need to do a custom login action ?

If so, be aware we will release a new Xano action so you can set the auth token in a workflow yourself. should be released next week.

The javascript code you can use as a workaround is :

```javascript
wwLib.wwPlugins.xanoAuth.storeToken(yourAccessToken)

```

---

<div class="post-metadata">

**Author:** ![Ran](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@Ran](https://community.weweb.io/u/Ran)\
**Post date:** [July 6, 2023, 3:01pm UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/29 "2023-07-06T15:01:31Z")

</div>

Hi Alexis,  
Yes, i do have the Xano Auth plugin installed.  
I need the custom login for a use case of reseting a password,  
to do so, i have used the “password reset” snippet and it is working great apart from the fact that when the user clickes the email link he is being redirected to the reset password page in which i have placed to JS code above. But although he is looged in on the Xano side, he is not actually loged in on weweb,  
only after refreshin the page he is being “loged in” also in Weweb…

As for the workaround, where should i implimant it? with in the JS?  
Thanks

---

<div class="post-metadata">

**Author:** ![Alexis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/alexis/32/13248_2.png) [@Alexis](https://community.weweb.io/u/Alexis)\
**Post date:** [July 6, 2023, 3:06pm UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/30 "2023-07-06T15:06:32Z")

</div>

Yes, use it inside your custom javascript action, instead of what you have currently 🙂

---

<div class="post-metadata">

**Author:** ![Ran](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@Ran](https://community.weweb.io/u/Ran)\
**Post date:** [July 6, 2023, 3:11pm UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/31 "2023-07-06T15:11:25Z")

</div>

Thanks 🙏

---

<div class="post-metadata">

**Author:** ![Alexander\_L](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@Alexander\_L](https://community.weweb.io/u/Alexander_L)\
**Post date:** [July 14, 2023, 10:18pm UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/32 "2023-07-14T22:18:14Z")

</div>

Hello. I’d like to upVote that this feature (logging in via an authToken only) be added! I have the same use case as folks above…and can see other reasons why this would be handy (passwordless login for example)

---

<div class="post-metadata">

**Author:** ![gbeaudoin](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/gbeaudoin/32/3221_2.png) [@gbeaudoin](https://community.weweb.io/u/gbeaudoin)\
**Post date:** [July 18, 2023, 11:48am UTC](https://community.weweb.io/t/login-with-authtoken-magiclink/775/33 "2023-07-18T11:48:56Z")

</div>

You can upvote [here](https://feedback.weweb.io/)

[Previous page](https://community.weweb.io/t/login-with-authtoken-magiclink/775.md?page=1)
