From 85e954aa3721e068172e770a742c49feb50e75b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Tue, 27 Oct 2020 18:43:07 +0000 Subject: [PATCH] Login: Avoid AJAX error on login screen. This has to do with the password generator, which does not need to generate and cache passwords in JS as that's already done in PHP. Props adamsilverstein, sarahricker. Fixes #51613. Built from https://develop.svn.wordpress.org/trunk@49337 git-svn-id: http://core.svn.wordpress.org/trunk@49098 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/user-profile.js | 7 ------- wp-admin/js/user-profile.min.js | 2 +- wp-includes/version.php | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/wp-admin/js/user-profile.js b/wp-admin/js/user-profile.js index 14c10b63bd..54e331bf1d 100644 --- a/wp-admin/js/user-profile.js +++ b/wp-admin/js/user-profile.js @@ -146,13 +146,6 @@ bindToggleButton(); - // Generate the first password and cache it, but don't set it yet. - wp.ajax.post( 'generate-password' ) - .done( function( data ) { - // Cache password. - $pass1.data( 'pw', data ); - } ); - $generateButton.show(); $generateButton.on( 'click', function () { updateLock = true; diff --git a/wp-admin/js/user-profile.min.js b/wp-admin/js/user-profile.min.js index 20ee0c13bd..8067336be4 100644 --- a/wp-admin/js/user-profile.min.js +++ b/wp-admin/js/user-profile.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(r){var e,a,t,n,i,o,d,p,l,c,u=!1,h=wp.i18n.__;function w(){"function"==typeof zxcvbn?(!a.val()||c.hasClass("is-open")?(a.val(a.data("pw")),a.trigger("pwupdate")):v(),b(),1!==parseInt(o.data("start-masked"),10)?a.attr("type","text"):o.trigger("click"),r("#pw-weak-text-label").text(h("Confirm use of weak password"))):setTimeout(w,50)}function f(s){o.attr({"aria-label":h(s?"Show password":"Hide password")}).find(".text").text(h(s?"Show":"Hide")).end().find(".dashicons").removeClass(s?"dashicons-hidden":"dashicons-visibility").addClass(s?"dashicons-visibility":"dashicons-hidden")}function m(){var s;e=r(".user-pass1-wrap, .user-pass-wrap"),r(".user-pass2-wrap").hide(),p=r("#submit, #wp-submit").on("click",function(){u=!1}),d=p.add(" #createusersub"),n=r(".pw-weak"),(i=n.find(".pw-checkbox")).change(function(){d.prop("disabled",!i.prop("checked"))}),(a=r("#pass1")).length?(l=a.val(),1===parseInt(a.data("reveal"),10)&&w(),a.on("input pwupdate",function(){a.val()!==l&&(l=a.val(),a.removeClass("short bad good strong"),b())})):a=r("#user_pass"),t=r("#pass2").on("input",function(){0]*>/gi,"");n[s].length&&-1===r.inArray(a,t)&&(t.push(a),r("