Opened 4 years ago
Closed 4 years ago
#51922 closed defect (bug) (fixed)
Application Passwords: Ambiguous error when recording password usage
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.6 | Priority: | normal |
Severity: | normal | Version: | 5.6 |
Component: | Application Passwords | Keywords: | has-patch commit dev-reviewed |
Focuses: | Cc: |
Description
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.
Attachments (1)
Change History (7)
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
4 years ago
#3
@
4 years ago
Great catch @dlh! Yeah I think returning true
makes sense here. I agree it isn't a 5.6 showstopper, will defer to @SergeyBiryukov on whether we should backport.
#4
@
4 years ago
- Owner set to TimothyBlynJacobs
- Resolution set to fixed
- Status changed from new to closed
In 49739:
Thanks for the patch! Moving to the milestone for visibility.