intoResponse method
Builds the response for this value.
Implementation
@override
Response intoResponse() {
final body = <String, Object?>{
'error': message,
if (fields.isNotEmpty) 'fields': fields,
};
final scheme = challenge;
return Response(
status,
body: jsonEncode(body),
headers: {
'content-type': 'application/json',
if (scheme != null) 'www-authenticate': _headerSafe(scheme),
},
);
}