I would like to make make an app for 3 kinds of user: Admin , A & B
I made already a condition that make me the admin “if user’s email = (my mail adress)” but if i want to give someone else the admin status i guess there is a better way.
But the main probleme is for the users A & B.
I made 4 different buttons: log in as A sign up as A Log in as B Sign up as B
When i tried the apps i could log in as B with the mail and password of a A user.
And that’s not something I want.
Is anyone can help me on how i should make the conditions etc…
For different users, add a property to User
Say I want a User as Seller (A) or Customer (B) or Admin. Create a property of the User to be “User Type” (text).
Then for A & B when a user signs up, depending on a checkbox create the User as a Seller or Customer by setting the text of “User Type” to “Seller” or “Customer”
For Admin you can change the “User type” to “Admin” in the backend yourself. But this solution means a user can only be A or B or Admin
Then you can restrict your app according to the text of “User Type”
For clients -
When page is loaded and user type is client go to page xyz.
For sellers -
When user type is seller go to page abc.
When both types of users have access to the same page two different containers can be created with contents in it.
Client container - visible when user type is client
Seller container visible when user type is seller
There are other ways of doing it as well, depending on what you want to do
I am having troubles with the process of making the “type of user”
In my app i go to the workflow of the button “sign up as user type A” and in the action “sign the user up” then I click on the “+ save some additional data” and I put the new characteristic User type = type A.
Then in the workflow of the button log in as user type A i had the condition "when current user’s user type is “type A”
But when I click on the log in as user type A button nothing happen.
(It works when i don’t use this condition on the log in button but this way i still have the problem that I can use the log in of an user type A pour the log in of the type B user)
Is it the correct way to create specific kind of users ??
Do I need to use this method --> on click event / Account / Create an account for someone else ??
In my app, I’m doing a check on page load to see if user is type A or B. If he is not type A, but he’s trying to get to a type A page, he gets redirected to a page telling him he doesn’t have permission. That’s the “catch” case, in case someone sneaks through. You could also use this logic to determine which types of groups to show on the page. For example, only show the bunny picture if the user is of type B, otherwise show the elephant.
In my app, there are only two types of users so I used a Boolean value instead of a text value. IsUserTypeA = yes/no
Good example. I do the same. On sign up I set the field to user type client & for service providers I have a separate sign up form & set the user type as provider.
On page load I set that if user type is client > navigate to …
Ok, I think I understand. You have “Student Account,” but those same credentials can log you in as a “Teacher Account.” This behavior is undesirable. Does this describe your situation?
Well I think the problem is that your conditional on the button is wrong because when you do the condition “Current User’s Type” this is getting the Current User (who is not logged in, generic, and does not have a type).
If you try this in the debugger even with the correct type of User, the debugger will say your type is empty because its getting the Current User not the User you’re trying to login as.
So like others have said above, your better approach would be to allow login of both types on the same page but depending on the Type of the User, display different things or navigate to different pages.
How do you get two user types to login differently and access different pages interconnected to each other like a Seller and a Customer in a native app where I am working with groups and not pages.