Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove features including SSO on wp-login/php #723

Merged
merged 1 commit into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions assets/js/lock-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ jQuery(document).ready(function ($) {
var opts = wpAuth0LockGlobal;
var loginForm = $( '#' + opts.loginFormId );

// Check SSO if Auth0.js is loaded and we have options.
if ( opts.ssoOpts && typeof(auth0) !== 'undefined' ) {
loginForm.hide();
var webAuth = new auth0.WebAuth({
clientID: opts.clientId,
domain: opts.domain
});
webAuth.checkSession(opts.ssoOpts, processSso);
}

// Missing critical Auth0 settings.
if ( ! opts.ready ) {
resetWpLoginForm();
Expand Down Expand Up @@ -74,35 +64,6 @@ jQuery(document).ready(function ($) {
Cookies.set( opts.nonceCookieName, val );
}

/**
* Callback function for webAuth.checkSession() SSO processing.
*
* @param err null|object Error returned from Auth0 or null if none.
* @param result object Result from Auth0.
*/
function processSso(err, result) {

// No session with Auth0 or error, show login form.
if (err || typeof(result) === 'undefined' || ! result || ! result.idToken) {
loginForm.show();
return;
}

// Set state and nonce cookies for validation.
setStateCookie(result.state);
setNonceCookie(result.idTokenPayload.nonce);

// Create a form to submit the necessary auth parameters to the callback URL.
$(document.createElement('form'))
.css({display: 'none'})
.attr('method', 'POST')
.attr('action', opts.ssoOpts.redirectUri)
.append($(document.createElement('input')).attr('name','id_token').val(result.idToken))
.append($(document.createElement('input')).attr('name','state').val(result.state))
.appendTo($('body'))
.submit();
}

/**
* Show the WordPress login form.
*/
Expand Down
Binary file modified languages/wp-auth0-es_ES.mo
Binary file not shown.
Loading