From e612354728031127bb0879db21c9aaf7805b323d Mon Sep 17 00:00:00 2001 From: TimothyBlynJacobs Date: Tue, 24 Sep 2024 16:40:17 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@59084 git-svn-id: http://core.svn.wordpress.org/trunk@58480 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-application-passwords.php | 4 ---- wp-includes/version.php | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/wp-includes/class-wp-application-passwords.php b/wp-includes/class-wp-application-passwords.php index 38ec4915de..b76b5c7e2a 100644 --- a/wp-includes/class-wp-application-passwords.php +++ b/wp-includes/class-wp-application-passwords.php @@ -94,10 +94,6 @@ class WP_Application_Passwords { return new WP_Error( 'application_password_empty_name', __( 'An application name is required to create an application password.' ), array( 'status' => 400 ) ); } - if ( self::application_name_exists_for_user( $user_id, $args['name'] ) ) { - return new WP_Error( 'application_password_duplicate_name', __( 'Each application name should be unique.' ), array( 'status' => 409 ) ); - } - $new_password = wp_generate_password( static::PW_LENGTH, false ); $hashed_password = wp_hash_password( $new_password ); diff --git a/wp-includes/version.php b/wp-includes/version.php index d25d85cd91..19ffddcf7c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-59083'; +$wp_version = '6.7-alpha-59084'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.