Fixed user authentication so it works for all pages.