checks for authentication on all page views