Refactor how security redirects user when they logout or are not authorized to view a page