Appearance
Return



Sign users in and get their info with Xano
Use Xano as your Authentication System to sign users in and load the signed-in user in your WeWeb app.
Steps at a glance
- Set Xano as your Authentication System.
- Create a simple sign-in form in the
Interface. - Sign the user in with the Xano
Sign Inworkflow template. - Load the signed-in user with the Xano
Fetch Current Userworkflow template. - Show the signed-in user's information in your app.
1) Set Xano as your Authentication System
Before building the sign-in flow, make sure your Xano project has:
- A sign-in endpoint that returns a token, such as
POST /auth/login - A current-user endpoint, such as
GET /auth/me - A
Meta API Key, so WeWeb can list your instances, workspaces, and API groups
Then in WeWeb:
- Open the
Data & APItab, then open theAuthenticationsubtab. - Choose
Xano. If you already use another provider, open theSettingstab, expandSwitch Authentication Provider, clickSwitch Authentication, then selectXano. - In
Connection, create or select a Xano connection: fill in yourMeta API Key, then select yourInstanceandWorkspace.

Learn more about connecting Xano →
2) Build a simple sign-in form
In the Interface:
- Add a form with inputs for the user's email and password.
- Add a button such as
Sign into submit the form.
3) Sign the user in
Select the form, open its Workflows tab and click New. Choose Xano, then the Sign In template. Keep or change the workflow name, then click Continue.

The workflow comes with three actions:
Sign in (Xano): select your Xano connection, your API group and your sign-in endpoint, such asPOST /auth/login. Then map the request body, for exampleemailandpassword, to your form values.Authenticate Xano: stores the token returned by Xano, so the user is signed in. It readsauthTokenoraccessTokenfrom the response.Navigate: select the page to send the user to after they sign in.

4) Load the signed-in user
The session is stored, but WeWeb does not know who the user is yet. To load the user:
In the
Workflowspanel, openApp Triggersand clickAdd. ChooseXano, then theFetch Current Usertemplate. It runs on theOn user loadtrigger.

In the
Fetch useraction, select your Xano connection and your API group. The template callsGET /auth/me: change the path if your endpoint is different.
The workflow ends with Set user, which saves the user returned by Xano in WeWeb. On user load runs right after sign in, and again when the app opens with a saved session, so the user stays signed in after a refresh.
5) Show the user's information
In any binding, open the Authentication tab and select a field under user. You find there the fields returned by your current-user endpoint. Typical things to show:

- Name
- Role or account type
You can now protect pages so only signed-in users can open them.
Common pitfalls
The user looks signed out after a refresh
- Make sure the
Fetch Current Userworkflow exists, and that it ends withSet user.
The sign-in request succeeds, but the user is not signed in
- Your endpoint returns the token under another key name. Update the
Auth Tokenbinding inAuthenticate Xano.
The user data is empty
- Make sure your Xano current-user endpoint returns the fields you want to display.
- Check that
Fetch useruses the right API group and path.

