i am trying to access the grav.user object to check if the visitor of the website is logged in. Unfortunately this object is not filled with the correct data. E.g. username is empty.
Dumping the content of grav.user gives me the following:
If a user tries to access that page, a login form will be presented. After the user logged in, the user object will show the correct data. If your user logs-out (right top corner of page), the user object will be empty again.
Hi @pamtbaau thank you very much for your fast response. Indeed i am not sure. Currently a question from my side arises:
Actually i want to check if an admin is logged in. Is there a difference between admin and user login?
I added the access requirement to the page and indeed even if i logged in as an administrator to the backend, it still asks me for login. So it looks like i am not logged in and thats the reason.
Then my question would be: how can i check in a theme template if the user is logged in to the admin plugin?