Skip to content

Updating visuals

If you see any images containing outdated UI, please bear with us.

We are updating all content as quickly as possible to mirror our new UI.

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 ​

  1. Set Xano as your Authentication System.
  2. Create a simple sign-in form in the Interface.
  3. Sign the user in with the Xano Sign In workflow template.
  4. Load the signed-in user with the Xano Fetch Current User workflow template.
  5. 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:

  1. Open the Data & API tab, then open the Authentication subtab.
  2. Choose Xano. If you already use another provider, open the Settings tab, expand Switch Authentication Provider, click Switch Authentication, then select Xano.
  3. In Connection, create or select a Xano connection: fill in your Meta API Key, then select your Instance and Workspace.
The Authentication settings in the Data & API tab, with the Xano connection selected

Learn more about connecting Xano →

2) Build a simple sign-in form ​

In the Interface:

  1. Add a form with inputs for the user's email and password.
  2. Add a button such as Sign in to 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 Xano workflow templates for an element: Sign In, Sign Up and Log Out

The workflow comes with three actions:

  1. Sign in (Xano): select your Xano connection, your API group and your sign-in endpoint, such as POST /auth/login. Then map the request body, for example email and password, to your form values.
  2. Authenticate Xano: stores the token returned by Xano, so the user is signed in. It reads authToken or accessToken from the response.
  3. Navigate: select the page to send the user to after they sign in.
The Sign in (Xano) action with its connection, API group, endpoint and request body

4) Load the signed-in user ​

The session is stored, but WeWeb does not know who the user is yet. To load the user:

  1. In the Workflows panel, open App Triggers and click Add. Choose Xano, then the Fetch Current User template. It runs on the On user load trigger.

    The Workflows panel open on App Triggers, with the Add buttonThe Fetch Current User template in the Xano app workflow templates
  2. In the Fetch user action, select your Xano connection and your API group. The template calls GET /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:

The Authentication tab of the binding window, with user, session and isAuthenticated
  • Name
  • Email
  • 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 User workflow exists, and that it ends with Set 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 Token binding in Authenticate Xano.

The user data is empty ​

  • Make sure your Xano current-user endpoint returns the fields you want to display.
  • Check that Fetch user uses the right API group and path.