Make WordPress Core


Ignore:
Timestamp:
09/24/2024 04:38:36 PM (4 months ago)
Author:
TimothyBlynJacobs
Message:

App Passwords: Don't prevent non-unique App Password names.

In [50030] we enforced that Application Passwords have unique names. This was done with the assumption that applications would not connect to a user multiple times. However, in practice we've seen applications run into issues with the unique name constraint. Depending on the app, they may not know if they've been authorized before, or they may intentionally allow connecting multiple times. To prevent friction, App developers need to make their App Name unique, and in doing so often include things like the current date & time, which is already included in the App Passwords list table.

This commit removes this requirement to simplify usage of the Authorize Application flow.

Props mark-k, Boniu91, timothyblynjacobs, peterwilsoncc.
Fixes #54213.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-application-passwords.php

    r59009 r59084  
    9393        if ( empty( $args['name'] ) ) {
    9494            return new WP_Error( 'application_password_empty_name', __( 'An application name is required to create an application password.' ), array( 'status' => 400 ) );
    95         }
    96 
    97         if ( self::application_name_exists_for_user( $user_id, $args['name'] ) ) {
    98             return new WP_Error( 'application_password_duplicate_name', __( 'Each application name should be unique.' ), array( 'status' => 409 ) );
    9995        }
    10096
Note: See TracChangeset for help on using the changeset viewer.