Redirect on login and logout
Fixed wrong function