[wp-trac] [WordPress Trac] #51922: Application Passwords: Ambiguous error when recording password usage
WordPress Trac
noreply at wordpress.org
Thu Dec 3 07:34:35 UTC 2020
#51922: Application Passwords: Ambiguous error when recording password usage
-----------------------------------+-----------------------------
Reporter: dlh | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Application Passwords | Version: 5.6
Severity: normal | Keywords: has-patch
Focuses: |
-----------------------------------+-----------------------------
`WP_Application_Passwords::record_application_password_usage()` returns
"True if the usage was recorded, a WP_Error if an error occurs."
If a password has already been used in the last day, the new usage isn't
recorded, and an error is returned. However, the error code given is
`application_password_not_found`, which doesn't seem accurate.
The attached patch would have the method return `true` when a password's
usage has already been recorded for the day on the theory that, at the
time, no error occurred.
Alternatively, a `WP_Error` with a different error code specific to this
case could be returned on the theory that the usage was not recorded
''this'' time.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51922>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list