From b93b4099763d45d28a4ada9823aa92ebf0935972 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 6 Jul 2020 16:14:04 +0000 Subject: [PATCH] Heartbeat: Do not disable the login prompts when the user needs to log in again but has closed the log in modal. Add a 5 minutes timeout before asking them to log in again. Props dsixinetu, adamsilverstein, azaozz. Fixes #49573. Built from https://develop.svn.wordpress.org/trunk@48337 git-svn-id: http://core.svn.wordpress.org/trunk@48106 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/wp-auth-check.js | 78 ++++++++++++++++++----------- wp-includes/js/wp-auth-check.min.js | 2 +- wp-includes/version.php | 2 +- 3 files changed, 52 insertions(+), 30 deletions(-) diff --git a/wp-includes/js/wp-auth-check.js b/wp-includes/js/wp-auth-check.js index be2a37cfc0..c5d3af18af 100644 --- a/wp-includes/js/wp-auth-check.js +++ b/wp-includes/js/wp-auth-check.js @@ -5,8 +5,10 @@ */ /* global adminpage */ -(function($){ - var wrap; +( function( $ ) { + var wrap, + tempHidden, + tempHiddenTimeout; /** * Shows the authentication form popup. @@ -15,18 +17,18 @@ * @private */ function show() { - var parent = $('#wp-auth-check'), - form = $('#wp-auth-check-form'), - noframe = wrap.find('.wp-auth-fallback-expired'), + var parent = $( '#wp-auth-check' ), + form = $( '#wp-auth-check-form' ), + noframe = wrap.find( '.wp-auth-fallback-expired' ), frame, loaded = false; if ( form.length ) { // Add unload confirmation to counter (frame-busting) JS redirects. - $(window).on( 'beforeunload.wp-auth-check', function(e) { - e.originalEvent.returnValue = wp.i18n.__( 'Your session has expired. You can log in again from this page or go to the login page.' ); + $( window ).on( 'beforeunload.wp-auth-check', function( event ) { + event.originalEvent.returnValue = window.wp.i18n.__( 'Your session has expired. You can log in again from this page or go to the login page.' ); }); - frame = $('