Newbie here. I want to make a part of a site accessible only for a certain user group without panel access. I followed the recipe and on my Localhost (Mamp) everything works fine.
When I move the files to the remote server everything works except the logout function. The user is not logged out and not redirected to the login page. The error page of my theme (Zero One) is shown instead. Both hosts run on PHP 8.2. Running out of ideas …
Thanks a lot for the quick reply but that did not help. I have only one config-file that contains the route but the logout link still has the same behavior and throws an error.
As I suspected, you overwrite the routes key later in the file, i.e. you have the routes key right at the top of the file, and then later again a routes key after the hooks, but each key can only exist once. So move the logout route inside the other routes.
BTW, when posting code, use three backticks before and after the code block, like in this screenshot: