Make WordPress Core

Changeset 49920 for trunk


Ignore:
Timestamp:
01/02/2021 10:19:21 PM (4 years ago)
Author:
TimothyBlynJacobs
Message:

App Passwords: Correct authorize app action names and signatures.

When App Passwords was introduced, the wp_authorize_application_password_form and wp_application_passwords_approve_app_request_success hook were mistakenly duplicated and incorrectly documented. This commit corrects the hook names and ensures the correct parameters are passed.

Props johnbillion, engahmeds3ed.
Fixes #52013.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/auth-app.js

    r49716 r49920  
    6262            /**
    6363             * Fires when an Authorize Application Password request has been successfully approved.
     64             *
     65             * In most cases, this should be used in combination with the {@see 'wp_authorize_application_password_form_approved_no_js'}
     66             * action to ensure that both the JS and no-JS variants are handled.
    6467             *
    6568             * @since 5.6.0
     
    127130             *
    128131             * @since 5.6.0
     132             * @since 5.6.1 Corrected action name and signature.
    129133             *
    130134             * @param {Object|null} error       The error from the REST API. May be null if the server did not send proper JSON.
     
    133137             * @param {jqXHR}       jqXHR       The underlying jqXHR object that made the request.
    134138             */
    135             wp.hooks.doAction( 'wp_application_passwords_approve_app_request_success', error, textStatus, jqXHR );
     139            wp.hooks.doAction( 'wp_application_passwords_approve_app_request_error', error, textStatus, errorThrown, jqXHR );
    136140        } );
    137141    } );
  • trunk/src/wp-admin/authorize-application.php

    r49752 r49920  
    201201            <?php
    202202            /**
    203              * Fires in the Authorize Application Password new password section.
     203             * Fires in the Authorize Application Password new password section in the no-JS version.
     204             *
     205             * In most cases, this should be used in combination with the {@see 'wp_application_passwords_approve_app_request_success'}
     206             * action to ensure that both the JS and no-JS variants are handled.
    204207             *
    205208             * @since 5.6.0
     209             * @since 5.6.1 Corrected action name and signature.
    206210             *
    207211             * @param string  $new_password The newly generated application password.
     
    209213             * @param WP_User $user         The user authorizing the application.
    210214             */
    211             do_action( 'wp_authorize_application_password_form', $request, $user );
     215            do_action( 'wp_authorize_application_password_form_approved_no_js', $new_password, $request, $user );
    212216            ?>
    213217        <?php else : ?>
Note: See TracChangeset for help on using the changeset viewer.