Improve logic to handle a user that isn't logged in trying to access a protected page.