Refactor newauth to use current_app.