I'm trying to disallow user to sign-in or sign-up when he is already signed-in and vica versa. I have method that returns boolean of user's state. And then I have a controller that extends from template's controller and in it - before() method that should check for that state and, if it's true, redirect to main page. I can't get where's the problem...
function before() {
if ( Diesel::is_signedIn() !== null ) {
$this->response->redirect( 'index' );
}
}
Thanks, you're the best! Forgot that template's controller may use before() (and after(), and ..) as well.
P.S. You can use Diesel::is_signedIn() instead of Diesel::is_signedIn() !== null.