extract method
Produces the value, or the rejection that stops the handler.
Implementation
@override
Future<Result<String, Rejection>> extract(Request request) async {
final value = CookieJar.of(request)[name];
if (value == null || value.isEmpty) {
return Err(
Rejection.unauthorized(
'expected a $name cookie',
challenge: 'Cookie',
),
);
}
return Ok(value);
}