pub fn unauthorized<Body: Default>(description: &str) -> Response<Body>
Expand description

Build a 401 Unauthorized response with the appropriate www-authenticate header

The description provided will be automatically escaped to make sure it is header-friendly.

The prepared response will have the form:

HTTP/1.1 401 Unauthorized
www-authenticate: Bearer error="invalid_token" error_description="{description}"

error_description is omitted if description is empty.