1. Home
  2. Docs
  3. NoCode-X Documentation
  4. Tutorials
  5. Create a secure medical platform with NoCode-X (Part II): Creating a login page

Create a secure medical platform with NoCode-X (Part II): Creating a login page

In Part I we created a register page, allowing new users to create accounts on our web app. We will now cover the following topics:

  1. Creating a login page
  2. Routing users to the login page after registering
  3. Creating a page that only logged in users can access

The login page design

Let’s start things off by creating a new page with the navigation bar from Part I of this series by entering the template hierarchy. More information about this procedure can be found in the template hierarchy article and the previous tutorial.

Rename the template in the Template properties tab. It may look something like this:

The empty login page template

Add the following components to this template:

  • A plane to house all components
  • A title with the text Login, two smaller titles with the text Your email and Your password.
  • An email field
  • A password field
  • A button (to log in)
  • A link (forgot password)

The end result might look something like the image below.

The finished login page.

Implementing the login functionality

At the moment NoCode-X does not support custom login functionality. Users will be prompted with the default NoCode-X login screen when trying to access a page that requires authentication. Custom login pages will be implemented soon.

Routing registered users to the login page

We can now send newly registered users to the login page. Go back to the register template from Part I of this series, and go to the Actions tab in the Component menu for the Submit button. Press the plus icon, indicated by a red arrow in the image below, to create a new action for this component.

This image indicates how to create a new action for the submit button.

Edit the new action’s attributes, then add the Route to page function call to the grid and connect it to the start block.

Route to page action.

Then select the register page in the Arguments tab in the Invocation configuration for the Route to page component.

The arguments tab in the invocation configuration menu for the Route to page component.

Your changes are saved automatically. Go back to the register template, start a preview and click the Submit button to test if it works!

Creating a page only logged in users can access

By default, a page can be accessed by anyone. We will now create a page for which this is no longer the case: a members-only page. In later tutorials, we can add personal information and medical data on this page. Right now we will create a very simplistic placeholder template, to demonstrate the authorization feature.

The authenticated users only page.

Click the Authorization tab in the menu on the left. Check the box. Your screen will now look something like the image below:

The authorization tab with no rules in effect.

Click the Add authorization rule button. You can now start adding rights and groups to this rule. This is discussed in detail in the Authorization and User management articles. In the image below, we assign the group Registered user to this rule, so only registered users can access the page. This only works if every registered user is placed in this group first.

Manage permissions of the template.

In the next article, we will discuss how to make the navigation bar functional.

Was this article helpful to you? Yes No

How can we help?