How to login as customer for super admin (when using xano plugin)

So I have users on my app who need me to login to their app and check their setup.
I have to get their username and password everytime to do that.

Is there a way I can do it since i am the owner

How do you go about doing this ?

My goal is to quickly log into customer accounts without having to get their passwords
AFTER i login as admin.

Or i can generate auth token or whatever needed from xano backend and then try to login as customer as well.

thanks

Figured it out , posting solution for anyone else who might be looking for this.

Get auth token with a new API only superadmins can access (lock it in xano with a pre condition so noone else can access it)

Then store that token in STORE AUTH TOKEN action

Then do Fetch User and viola , you are in as your customer

Weweb is awesome.

image

4 Likes

Awesome! Nicely done :slight_smile: Thanks a lot for taking the time to share the solution with everyone on here. Really appreciate it!

1 Like

Hi @dingan , very interesting challenge.

Would it be possible for you to elaborate more on the " new API only superadmins can access"?

How do you make Xano create an auth token as if it were of a customer user?

Thank you for the help!
Joao

It just mean … you create a new API end point in Xano
Call it whatever you want. I called it superAdminsOnly
It will take an input “userID”

You will pass the id of the user as userID
(for example , you want to login as user 45 , you pass 45)

In the endpoint , first step would be to check if the user who is requesting is an admin or not.
AUTH ID should be an admin id
Then if they are an admin , use Generate auth token action in xano to generate access token for the user id which was passed as payload

Thanks