Skip to content

Commit

Permalink
fixup! Add the ability to configure multiple IdPs
Browse files Browse the repository at this point in the history
  • Loading branch information
jrchamp committed Oct 11, 2024
1 parent 9d0d3fd commit ceb3853
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions assets/js/shibboleth_login_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,30 @@
* Originally from Automattic's Jetpack SSO module (v5.3)
*
* @see https://github.com/Automattic/jetpack/blob/5.3/modules/sso/jetpack-sso-login.js.
* @package
* @package shibboleth
*/

jQuery(document).ready(function ($) {
const body = $('body'),
ssoWrap = $('.shibboleth-wrap'),
loginForm = $('#loginform'),
overflow = $('<div class="shibboleth-clear"></div>');
jQuery( document ).ready(
function ( $ ) {
const body = $( 'body' ),
ssoWrap = $( '.shibboleth-wrap' ),
loginForm = $( '#loginform' ),
overflow = $( '<div class="shibboleth-clear"></div>' );

// The overflow div is a poor man's clearfloat. We reposition the remember me
// checkbox and the submit button within that to clear the float on the
// remember me checkbox. This is important since we're positioning the SSO
// UI under the submit button.
//
// @TODO: Remove this approach once core ticket 28528 is in and we have more actions in wp-login.php.
// See - https://core.trac.wordpress.org/ticket/28528.
loginForm.append(overflow);
overflow.append($('p.forgetmenot'), $('p.submit'));
// The overflow div is a poor man's clearfloat. We reposition the remember me
// checkbox and the submit button within that to clear the float on the
// remember me checkbox. This is important since we're positioning the SSO
// UI under the submit button.
//
// @TODO: Remove this approach once core ticket 28528 is in and we have more actions in wp-login.php.
// See - https://core.trac.wordpress.org/ticket/28528.
loginForm.append( overflow );
overflow.append( $( 'p.forgetmenot' ), $( 'p.submit' ) );

// We reposition the SSO UI at the bottom of the login form which
// fixes a tab order issue. Then we override any styles for absolute
// positioning of the SSO UI.
loginForm.append(ssoWrap);
body.addClass('shibboleth-repositioned');
});
// We reposition the SSO UI at the bottom of the login form which
// fixes a tab order issue. Then we override any styles for absolute
// positioning of the SSO UI.
loginForm.append( ssoWrap );
body.addClass( 'shibboleth-repositioned' );
}
);

0 comments on commit ceb3853

Please sign in to comment.