I'm using Xano as my database. In WW, my xano auth returns the user as null. What could be the issue?

I am having some issues with my user details returning as null in weweb.

I already connected to the correct API endpoint for authentication.


I’ve seen under Xano Auth user variable, object value is null.

What I would like is to display the data of the current logged-in user on their dashboard (i.e. their name). However, I could not do that because there’s no data returning from Xano.

I want weweb to get these fields.

It was working before, but later on, it didn’t work. What could be the issue?

Hi, where are you calling the login action ?

Hi Alexis! Thanks for the immediate response. My apologies, but it is actually working already. :laughing:

It seems that it’s a server issue, and I just need to wait for some time before it fully connects to the API I set it to.

1 Like

Hi Alexis!

I’m having the same trouble again with this. I am not sure why it keeps happening every time I get back to my project. It was working before, and now it’s not.

Is there a bug in here? Because the user value (Variables>From Xano Auth > User) kept coming back as “null” in editor mode.

Below picture (Editor mode), in the submit workflow I always encounter error 401 because it cannot pick up the user.id.

Same issue in getting the username to appear in the app dashboard. It doesn’t show cos user details are null. (it was working before)

However, when I try it in our live app, it works. See below pictures.

Form:


Xano DB:

Even in the dashboard in live app, it shows my name.
image

I am so confused about why it doesn’t work in the editor. I tried to publish it again, but I am still having trouble. :sob: :sob: :sob:

Just taking a guess here…

Are you logging in with one of your ‘users’ each time you go back to your editor?

The Xano authToken typically expires after 24hrs (unless you’ve changed that). If your endpoint /dispatch_request_private requires authentication, then you need to make sure you have a ‘logged in user’ testing it within the editor.

Check the request history of your /dispatch_request_private endpoint in Xano. It’s likely it is throwing an ‘unauthorized’ error.

… actually this screenshot confirms you don’t have a user logged in user.

Hi Michael!

Thank you for your fast response. Yes I am logged in as a user whenever I test everything on my app.
I’ve checked the request history in my /dispatch_request_private endpoint too and it is showing error 401 because weweb cannot pick up the user.id which is one of the requirements of the form.

The Xano 401 error code is reserved for an unauthorized request, so your when you called your endpoint from Weweb it never sent an authToken.

In your editor, can you go to your login page > sign a user in, and take a screen shot of the response? ie. similar to the workflow screenshot you have above.

Hi Michael!

Here you go. It did sent an authToken.

I cannot really locate the problem here.
Thank you for helping out

Hi, I think you’re not using the login action from our xano auth plugin right ? You’re using the xano request action. As a result it will not fill the variables from the Xano Auth plugin.

Hi Alexis!

Yes, indeed, I tried to swap it with Xano Requestin hopes that it would work but it still did not work “earlier”.

BUT then… I switched it back to Xano Login again now as you said. Now it works :smiling_face_with_tear:

Thank you again! I hope it will not restart again tomorrow.

As mentioned by @MichaelLovell its possible you have to login again after a certain amount of time depending of the configured token expiration. (And we also may have a bug about that)

1 Like