refactoring
redirect to the login form when authentication failed