modified before_app_request callback in auth/views