I made a postHook that checks in what group a loggedinuser is in to redirect it to the correct landing page:
<?php
if ($modx->user->isAuthenticated() && $modx->user->isMember('Dealers')) {
$modx->sendRedirect($modx->makeUrl(29));
exit();
} elseif ($modx->user->isAuthenticated() && $modx->user->isMember('Garagehouders')) {
$modx->sendRedirect($modx->makeUrl(135));
exit();
} else {
return;
}
but $modx->user->isMember() is false at that moment snippet runs, once logged in and i do logout its true?!
the $modx->user->isAuthenticated() is true and when logged out its false
both results I got when I put var_dumb($modx->user->isAuthenticated()) and var_dumb($modx->user->isMember(’myGroupName’)) on the top of this snippet.
I think this is not the expected behavior.
is this a bug? or am I missing something?