Prevent browser from storing password if signup failed

Viewed 33

I have a sign up form with email and password/repeat-password fields, using Bootstrap 4 and jQuery. These get submitted to my API using jQuery $.post().

The issue is that even if the signup fails - for example if the email already exists - Chrome offers to save the password. This is annoying.

How can I prevent Chrome from doing so only if the signup fails, but not if it succeeds?

When searching I've only found questions and answers about how to completely disable the feature - but I want it to be disabled only if the POST failed, not if it was successful. Also, I do not wish to disable the password autocomplete feature.

0 Answers
Related