Hello, i currely have a adminpanel with mydomain.com/admin - however, how i have it so if im not the role “admin” i will be redirected to the index page. What i would like to do is instead redirect to a path like mydomain.com/admin/signin. How can i go about doing this?
My first idea was to hide everything if user is not admin and show a group called “login” instead and change the url to mydomain.com/admin/signin, but i don’t know how secure that is? Is that how websites are usually built or?
When page is loaded and current user is signed out OR when page is loaded and current user type is not admin → go to page (arbitrary text: page/signin)
Then put a conditional on the Group Signin when → Get data from URL (path segments as a list) item # 2 is signin, this element is visible
I have several sites like this with an Admin panel and I do what this answer says.
I always have a conditional that checks whether the Current User is signed out. If they are they are redirected to a Login panel of some sort. Once logged in, the conditional then checks if the Current User’s role is “Admin” (or some other appropriate phrase) and if so, then routes them to the Admin panel, or let’s them see the Admin panel.
If a user is logged in and somehow makes it to the Admin panel, but is NOT an Admin role, they are immediate logged out and redirected back to the Login panel (or wherever else is appropriate).