Added login support and redirection