Create a Single Login Page for Multiple User Roles

Create a unified login page that lets all user roles access your Knack app from a single entry point, with automatic navigation based on role permissions.

What You'll Learn

  • How to create a single login page that all user roles can access
  • How to add a welcome message for logged-in users
  • How to use page rules to redirect users based on their role

Use Case

Multiple user roles interact with your app, and you want to provide a seamless experience by letting all users log in from a single page. For instance, your app has both Managers and Employees, each with their own dedicated pages, but you want them all to access the app from a unified "Welcome" page.

Requirements

  • Two or more user roles are set up in your app
  • Page menu tabs are set to show based on the logged-in user's role
  • Separate login pages are in place for each user role

Steps

This setup uses a "Welcome Page" where every user logs in and accesses their role-specific tabs.

Adding a New Login Page for All User Roles

Make sure you have at least two login pages set up in the Pages section of the Builder.

  1. Click the + button and choose the Login Page option from the dropdown menu.
  1. You'll be prompted to set up your new page by specifying which user roles should have access. Select Give permission to all users and click Continue.
  1. Name your new page. In this example, we've named it "Welcome Page."

Adding a Rich Text Element With a Welcome Message

After setting up user access and naming your page, add a rich text element to display a welcome message with helpful instructions.

  1. Select the Rich Text element type from the toolbox on the left-hand side.
  1. Open the element editor and type your welcome message. Use the formatting options above the text input to customize how your message appears.

Login and Test

Test your new single login page in the Live App.

  1. Click Preview or Go to Live App in the top navigation.
  1. Log in using the credentials for one of your user roles. After a successful login, you'll see the welcome message and have access to all pages available for that role.

Optional: Redirect Users by Role Using Page Rules

You can also create a landing page that redirects users to the appropriate page based on their role.

  1. Create a landing page accessible to all users.
  2. Add a page rule that redirects users based on their user role.

For example, admins could be directed to a dedicated admin page upon logging in where they can view their projects.

Next Steps