Repository navigation
Application password UX improvements - #11079
johnbillion wants to merge 22 commits into
Conversation
…s the one on the profile screen.
…t, it should not send any data to the requesting site or app.
…ost exclusively used for phishing and is deprecated in modern browsers.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
Great improvements here :) |
# Conflicts: # src/wp-admin/includes/user.php # tests/phpunit/tests/admin/Admin_Includes_User_WpIsAuthorizeApplicationRedirectUrlValid_Test.php
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @domenico-ruggiano. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
I think a direct POST is fine, the checkbox is a safety net more than an enforcement. |
joedolson
left a comment
There was a problem hiding this comment.
Only one of these requested changes (the implicit label) is solely within new code; if you choose not to make the other changes, let me know, and I'll open those as a separate ticket.
|
|
||
| setTimeout( function() { | ||
| $successElement.addClass( 'hidden' ); | ||
| }, 3000 ); |
There was a problem hiding this comment.
For me, this feels like too rapid a timeout. I'd prefer if it was dismissable, instead of timing out, but barring that more substantial change, a time out of at least 20 seconds would be preferable.
There was a problem hiding this comment.
(This is also true of the existing copy button when creating application passwords in a user profile.)
| .append( $( '<p></p>' ).text( wp.i18n.__( 'You have not approved this connection. No data has been shared with the application.' ) ) ); | ||
|
|
||
| $form.replaceWith( $notice ); | ||
| $notice.trigger( 'focus' ); |
There was a problem hiding this comment.
Setting focus to a container that also has role="alert" will usually result in double-announcing the notification. (This is also true in the existing code, line 129.)
Since focus has to be changed, due to the removal of the form contents and current focus location, I'd recommend removing the alert role to prevent the duplicate announcement.
| .append( ' <button type="button" class="button copy-button">' + wp.i18n.__( 'Copy' ) + '</button>' ) | ||
| .append( '<span class="success hidden" aria-hidden="true"> ' + wp.i18n.__( 'Copied!' ) + '</span>' ) | ||
| ) | ||
| .append( '<p>' + wp.i18n.__( 'Be sure to save this in a safe location. You will not be able to retrieve it.' ) + '</p>' ); |
There was a problem hiding this comment.
This is an existing issue, but this text should be connected to the password input via aria-describedby.
There was a problem hiding this comment.
The direction here is right and the reject-branch open redirect is genuinely closed — authApp.reject is gone, the PHP reject branch is an unconditional admin_url(), and I could not get past the new userinfo rejection with literal @, %40, doubled @, backslashes or whitespace. CSRF, capability checks and output escaping all survive the rewrite intact.
Five things below, two of which are regressions this PR introduces rather than pre-existing issues.
One further point I'd like to raise with you directly rather than here — I'll follow up separately.
Note also that joedolson's CHANGES_REQUESTED from yesterday is still open with five inline comments and no commits since, so some of this may already be on your list.
AI assistance: Yes. Tool(s): Claude Code. Used for: reviewing the diff against trunk, empirically verifying parse_url() behaviour, and checking the no-JS form path.
|
|
||
| // If redirecting to an external site, gate the approve button behind the confirmation checkbox. | ||
| if ( authApp.successHost ) { | ||
| var $checkbox = $( 'input[name="confirm_external_redirect"]' ); |
There was a problem hiding this comment.
Minor, but it makes the gate weaker than it looks: the approve button is disabled with .prop( 'aria-disabled', true ).
jQuery's .prop() with a hyphenated, non-native name sets an expando property on the element rather than an attribute, so nothing is reflected into the DOM and assistive technology never sees the disabled state. The click guard further down then returns silently with no feedback.
.attr() / .removeAttr() throughout would make it real. Alternatively drop the manual disabled state entirely and lean on the existing reportValidity() call, which already surfaces the required-checkbox message natively.
|
Judging from the screenshot I'd like to propose some changes in the order and copy, to make things even clearer and easier scannable: An application would like to connect to your account. New Application Password Name: An application would like to connect to your account. You should only do this if you trust the application in question.
Caution The data will send to: evil.com
And then, when a application password was created, I think we should add links to the success screen:
|


A collection of UX enhancements for the authorize-application.php screen, with a particular focus on hardening against phishing.
username:password@credentials in URLsScreenshots
Ticket
Trac ticket: https://core.trac.wordpress.org/ticket/66009