I’m looking to create a site that is entirely restricted to users who are logged in. I have found the role based redirects, but can’t seem to get it working how it needs to. I need the redirects to:
- Redirect any unauthenticated user from any route, to /login/ route.
- Redirect any authenticated user from /login/ to /
Is this possible? I’ve got as far as:
# Always allow access to the login page /login/ /login/ 200 # If visitor has 'user' with role of editor set, let them in. /* 200! Role=user # else redirect back to login /* /login/ 401!