Rejection.unauthorized constructor

const Rejection.unauthorized(
  1. String message, {
  2. String challenge = 'Bearer',
})

A 401 rejection.

challenge becomes the WWW-Authenticate header, which the HTTP specification requires on a 401. It defaults to Bearer; pass another scheme when the extractor authenticates differently.

Implementation

const Rejection.unauthorized(String message, {String challenge = 'Bearer'})
    : this._(401, message, const {}, challenge);