# TUTORIAL – How to Setup Xano Authentication and Gate Content in WeWeb 🔐

**URL:** <https://community.weweb.io/t/tutorial-how-to-setup-xano-authentication-and-gate-content-in-weweb/276>\
**Category:** Tutorials\
**Tags:** gate-content, authentication, xano\
**Created:** [March 1, 2022, 4:49pm UTC](https://community.weweb.io/t/tutorial-how-to-setup-xano-authentication-and-gate-content-in-weweb/276 "2022-03-01T16:49:17Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![heyjcm](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/heyjcm/32/13039_2.png) [@heyjcm](https://community.weweb.io/u/heyjcm)\
**Post date:** [March 30, 2025, 4:00pm UTC](https://community.weweb.io/t/tutorial-how-to-setup-xano-authentication-and-gate-content-in-weweb/276/21 "2025-03-30T16:00:01Z")

</div>

> [@Joyce](#):
>
> ## Create Roles and Permissions
> 
> ### Adding Roles to Xano API Endpoint
> 
> In order to gate content in WeWeb based on user roles and permissions, you first need to create a `role` column in your Xano user base.
> 
> If you have a column with user roles in your Xano user base, you will be able to add it to the output of your `me` endpoint:
> 
> ![add role ro me output in xano auth](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/401d03fed7da12c6ea2b31c9605e9cb79028ad57.gif)
> 
> Once you’ve added roles to the output of the `me` endpoint of your Xano auth, you can add them to WeWeb.
> 
> ### Telling WeWeb Where to Find the User Role Info in Xano
> 
> Here, it’s in the `role` column so that’s what we type in:
> 
> ![role in user info](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/9e727ae39671e9c272f2d1beb2f099048ba476f4.png)
> 
> Then, you can add user groups where user roles match the data in Xano.
> 
> ### Adding User Groups in WeWeb
> 
> ![define-user-groups](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/3eada74256d1189d0fa52e38b583688963094551.gif)
> 
> Note that user role categories in Xano match the user roles in WeWeb:
> 
> #### User roles in Xano
> 
> ![user roles in xano](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/ea79895e32e0d6aff5930256b1dcd6cd9c33f7b8.jpeg)
> 
> #### User roles in WeWeb
> 
> ![define user groups in weweb](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/0ddbb2b6add86fd973161e5d4d3c446ee506deab.png)
> 
> ## Gate Content Based on User Roles
> 
> Once you’ve setup user roles in WeWeb, you can `Manage access to pages`  
> and define rules for `Private access`:
> 
> ![gate-content-with-xano-roles](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/1X/dbcfb4476752877603ebd795a2f127cfc4fcb0b0.gif)

Hi, @Joyce! I followed your instructions.

While in the Editor, your instructions worked fine and I’m able to login as a user which kicks off a workflow to “Navigate to” the user’s “dashboard” page that is locked down to authenticated users. The dashboard page shows all the links that the authenticated user has access to. When they click on those links it takes them to another locked down page called “overview” that is dynamically populated by data from Xano.

So the flow is: my\_domain/login\_page → my\_domain/dashboard → my\_domain/overview

However, after I publish the project to my hosted plan, the Navigate to dashboard page after a user logs in won’t show up. The behavior is that the user enters their email and password and clicks the login button; however, it just stays on the login screen and doesn’t go anywhere.

To fix this, I changed both the Dashboard page and the Overview page back to:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/c/c5d3c9f54ba514cf37a3d0fe601737a79f733b80.png)

And it functioned as normal (except for now they are not private pages). Did I miss a step?

**Here’s what I did to follow your instructions**

1. I added ‘role’ to my ‘user’ table in Xano:  

2. I added ‘role’ as an output to my /auth/me Xano endpoint:  

3. I used the WeWeb template Login page with the Login workflow that navigates to my ‘Dashboard’ page:  

4. I updated ‘Private access’ on the Dashboard page to only allow access to the standard user or the admin user role:  

5. I updated ‘Private access’ on the Overview page to only allow access to the standard user or the admin user role:  

Any recommendations on next steps?

Thanks in advance!

[Previous page](https://community.weweb.io/t/tutorial-how-to-setup-xano-authentication-and-gate-content-in-weweb/276.md?page=1)
