Login with authToken (MagicLink)

Thanks for this everyone, especially @kevinwasie :blush: 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:

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

Additionally, after the fetch user action fails, the token variable gets nulled out:
image

:thinking:

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

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

Many thanks!

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

noob question.

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

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

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

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

Appreciate the help. :raised_hands:

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

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 :

wwLib.wwPlugins.xanoAuth.storeToken(yourAccessToken)
1 Like

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

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

Thanks :pray:

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)

You can upvote here

1 Like