Index: components/password_manager/core/browser/password_manager.cc |
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc |
index 069e2abcb9293205f70a1c8600fc9a458ce598de..4ac56380d8cc3a3c275e7764b389308ca6812345 100644 |
--- a/components/password_manager/core/browser/password_manager.cc |
+++ b/components/password_manager/core/browser/password_manager.cc |
@@ -450,6 +450,16 @@ void PasswordManager::OnPasswordFormsRendered( |
DCHECK(IsSavingEnabledForCurrentPage()); |
+ // If the server throws an internal error, access denied page, page not |
+ // found etc. after a login attempt, we do not save the credentials. |
+ if (client_->WasLastNavigationHTTPError()) { |
+ if (logger) |
+ logger->LogMessage(Logger::STRING_DECISION_DROP); |
+ provisional_save_manager_->SubmitFailed(); |
+ provisional_save_manager_.reset(); |
+ return; |
+ } |
+ |
if (logger) { |
logger->LogNumber(Logger::STRING_NUMBER_OF_VISIBLE_FORMS, |
visible_forms.size()); |