4 Different user types at login

I have 4 user types and i have created login page 4 buttons for each when choosen it sets the custom state of the element ( login ) page to the set user, however when i login with an account different to the user type it allows me to login, and when i try using " only when " it allows any kind of email and pw to login, when opening the debugger it shows it catches the login’s user type but doesn’t validate it with current user- I have been on this for 10 hours tried 20 different only when combination types. nothing works.

Your issue is probably that before login in, the user is unknown, so most likely does not have yet all the info you’re expecting in your condition.

But, even before that : What do you want to achieve exactly? Why would you want to restrict login based on which role the user has?

I suppose you want to hide some content for some users, this is done after login, not before.

1 Like

I agree with you @bonjour_17 if every user type are required to fill both the email and password field, then why do they have to select their role before they can login?

If you need it for redirection, you can automatically pick this from the role field on the current user after they login.

But if you need this for signup, then selecting a role would be valid, since you would use the selected role to create an account for them.

1 Like

There are no sign ups, i add the users manually. bec of how the service i provide works. So i wanted that each user confirms his role before logging in so that when Email and password are provided it matches them with the user data, and then redirects them to the Dashboard specified for them. I have seen that everyone is actually redirecting after login i wondered if someone did what I want to do. But thank you! will probably do that then, what about when i put any ONLY WHEN condition no matter what type of email and pw i put in even if it invalid it logs in?

Yeah, I get where you are coming from I saw everyone doing that.

Hi @Abaza
if the login credentials are invalid, the user wont be able to login into the app.

Do you mean putting “ONLY WHEN” condition on the login action or on the redirect action?

I don’t think you need to put any condition on the login action, if the login credentials is correct the user would be logged in and if not, the user would get an error message.

You can put “ONLY WHEN” condition on the redirect action, to determine where each user type would be redirected to.

What I tried to do, is in login button i added ONLY WHEN - Login’s user type is current user’s user type. - And tried multiple combinations - What happens is with any ONLY WHEN condition i set any invalid email or password logs in. when i remove the ONLY WHEN condition it does validate email and password.

If it doesn’t expose your app too much. Can you share images of your conditional expression and workflow actions, so as to reduce too much back and forth.