Authentication using Xano Auth plugin

Hello Everyone,

I am trying to use the Xano Auth plugin in order to manage authentication for my WeWeb project.

So I added a workflow on the login form with the xano login action.

However when I click on “test”, the return I get from Xano is not an auth token as expected (wich is the outpout from my login endpoint in Xano) but the data related to the user.

It is like WeWeb didn’t call the auth/login endpoint in Xano but the auth/me endpoint :

The login endpoint URL saved in the Xano Auth plugin is correct, so I have no idea why it seems to be using the auth/me endpoint instead of the login endpoint.

Am I doing something wrong ?

Thank you for your help.

can you show a screenshot of your api stack in xano for your /login endpoint

Hi, here is a screenshot of the /login endpoint. It is just the default login endpoint provided by Xano in their “starter” template:

Hello,

Anyone has an idea on why I don’t get the expected response from Xano after the login ?

Thank you for your help.

Hello,

I have just checked the request history of the /auth/login and /auth/me endpoints in Xano, and each time I trigger the “login with Xano” action in WeWeb, it makes two requests: one to the /login endpoint and another to the /me endpoint.

Any idea on why WeWeb is calling the two endpoints instead of just the /login endpoint ?

Thank you.

one is for the auth token, the other is to get the user data

1 Like

Yes this call can seem redundant but sometimes the login endpoint does not return the current user, only the 200 status with a token for example. So we manage both endpoints as independent actions.

I will keep it in mind and see if we can optimise it in the future.

Thank you for your help dorilama and Alexis.

So it is perfectly normal that WeWeb is calling both the /login and /me endpoints to get both the token and the user information. I thought I did something wrong.

Thanks !