Simplifying authentication checking and redirection.