@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 believe that I could create another version of the plugin and create a Login With Magic Link Action, but I’m afraid of messing with that and breaking everything
Hey,
I am checking stuff with the backend team, and will come back to you.
In the meantime, setting cookie this way works, but it’s not time proof (it may change). @joyce can you add the action “Set cookie” to the needed feature?
FYI, added the following to our list of user suggestions for the product team to review: Auth improvement: add the action “Set cookie” + add the action “Login with Auth Token”
We also be adding it to our public roadmap and registering your upvotes so no action needed on your part
The set cookie action and the login with auth token action are the biggest, but it might be nice if there was a way to auth manually (ex. enter your auth token") instead of having to trigger the back-end logic and magic link emails every time. I often find myself sending myself a lot of these magic link emails and switching the redirect link (in Xano) between the editor site and my testing site.
Hi, I am also voting for the “Login with auth token” action to use passwortless auth.
@kevinwasie I tried your JS solution, but did not get it to work. I realised that you use “variables” but WeWeb gives me “pluginVariables” at this point. Here is the code anything I am missing?
The variables and cookie are being updated right away with that code. However, this is static, so the system will not sync with your Xano database unless you then tell it to do so.
The reason it is updating when you load the page again is because you are then calling some sort of user request on the Xano database.
If you want to try updating the user right away, after you set those variable, use a Fetch User action. I think this will be what you are looking for.
@kevinwasie I tried it with a fetch user action after the scripts, but it returns an error as the fetch user action seems not to use the token I received from magic_login.