Closed mehov closed 10 months ago
The code search is finding only the src/View/Helper/IdentityHelper.php
But how do I check whether a user is logged in inside a Controller?
You can read the current identity from $this->Authentication->getIdentity()
, if it isn't null, the user is logged in :smile:
In a view or a template I can call
isLoggedIn()
:But how do I check whether a user is logged in inside a Controller?
I want to load different templates based on if a user is logged in.