Commit 327c2dc4 authored by Manas Verma's avatar Manas Verma Committed by Commit Bot

[Autofill Auth] Updating OptChange request.

This CL ensures that fido_authentication_info is not set if it does not contain
any data.

Bug: 949269
Change-Id: I27ced9ba881d17c66bfc10c8467f9588ff91c091
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863642Reviewed-by: default avatarJared Saul <jsaul@google.com>
Commit-Queue: Manas Verma <manasverma@google.com>
Cr-Commit-Position: refs/heads/master@{#706243}
parent 7bcae4fa
......@@ -506,21 +506,22 @@ class OptChangeRequest : public PaymentsRequest {
}
request_dict.SetKey("reason", base::Value(reason));
base::Value fido_authentication_info(base::Value::Type::DICTIONARY);
if (request_details_.fido_authenticator_response.is_dict()) {
base::Value fido_authentication_info(base::Value::Type::DICTIONARY);
fido_authentication_info.SetKey(
"fido_authenticator_response",
std::move(request_details_.fido_authenticator_response));
}
if (!request_details_.card_authorization_token.empty()) {
fido_authentication_info.SetKey(
"card_authorization_token",
base::Value(request_details_.card_authorization_token));
}
if (!request_details_.card_authorization_token.empty()) {
fido_authentication_info.SetKey(
"card_authorization_token",
base::Value(request_details_.card_authorization_token));
}
request_dict.SetKey("fido_authentication_info",
std::move(fido_authentication_info));
request_dict.SetKey("fido_authentication_info",
std::move(fido_authentication_info));
}
std::string request_content;
base::JSONWriter::Write(request_dict, &request_content);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment