How to make a form to be shown only on the first user log in

Is it possible to make a form only shown when the user logged in for the first time?

My idea is, I will create usernames with random passwords but when the user logged in for the first time he will have to change password, next time he log in will take him directly to home page.

Rank: #143

Hello Faris,

You can use the Local Storage to achieve this.

Why don't you create a boolean variable to control if it is the first time or not?

Call it for instance HasChangedPassword.

By the time the user finishes that change password step, you update the flag value to true.

When you enter the application, you just need to verify if that value is true of false. If it is true, it means that the user already changed his password and you just need to redirect him to the Homepage instead.

Kind regards,

Rui Barradas

Rank: #1633

Hai Faris Abdullah Almozini 

If The Persistent Set To The NO its this One Time Role 


Hope This Will Help You 


Rank: #143

Hello Selva,

I'm not sure if your suggestion is the right approach. I just can't see how using roles can be a fit in this scenario.

Even though he's using a One Time Role created only for this purpose, he still needs to know when to grant that role to the user or not. Also, granting a role is a Server Action, which means that the client needs to call the server just for navigation purposes. Plus, he needs an additional logic to redirect the logged user to the Homepage if the user doesn't have the role to access that screen.

I'd stay with a flag in the Local Storage to control the navigation. I have an OnBoarding flow in my apps which I only show if it is the first time that the user logged in and I use this approach.

Kind regards,

Rui Barradas

Thank you all for your help, I used Local Storage and it did the job

Rank: #143

You're welcome Faris.

I'm glad that you managed to do it.

Kind regards,

Rui Barradas