Add authentication middleware.