App Passwords: Return true when rate limiting a password's last used time.

Previously we returned a `WP_Error` instance saying that the password was not found which is inaccurate.

Props dlh.
Reviewed by TimothyBlynJacobs, SergeyBiryukov.
Merges [49739] to the 5.6 branch.
Fixes #51922.

git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49740 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-12-03 17:21:48 +00:00
parent 43e3ca4f51
commit e6c5728b6c

View File

@ -203,7 +203,7 @@ class WP_Application_Passwords {
// Only record activity once a day.
if ( $password['last_used'] + DAY_IN_SECONDS > time() ) {
continue;
return true;
}
$password['last_used'] = time();