-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combining Lock init process; removing unused templates; Lock login fo…
…rm id constant
- Loading branch information
1 parent
76ad48f
commit b885c81
Showing
13 changed files
with
124 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* globals jQuery, console, Cookies, wpAuth0LockGlobal, Auth0Lock, Auth0LockPasswordless */ | ||
jQuery(document).ready(function ($) { | ||
var opts = wpAuth0LockGlobal; | ||
var loginForm = $( '#' + opts.loginFormId ); | ||
|
||
// Missing critical Auth0 settings | ||
if ( ! opts.ready || ! loginForm.length ) { | ||
$( '#form-signin-wrapper' ).hide(); | ||
$( '#loginform' ).show(); | ||
$( '#login' ).find( 'h1' ).show(); | ||
|
||
if ( ! opts.ready ) { | ||
console.error( opts.i18n.notReadyText ); | ||
} | ||
if ( ! loginForm.length ) { | ||
console.error( opts.i18n.cannotFindNodeText + '"' + opts.loginFormId + '"' ); | ||
} | ||
return; | ||
} | ||
|
||
// Set state cookie to verify during callback | ||
Cookies.set( opts.stateCookieName, opts.settings.auth.params.state ); | ||
|
||
// Set Lock to standard or Passwordless | ||
var Lock = opts.usePasswordless | ||
? new Auth0LockPasswordless( opts.clientId, opts.domain, opts.settings ) | ||
: new Auth0Lock( opts.clientId, opts.domain, opts.settings ); | ||
|
||
// Check if we're showing as a modal, can be used in shortcodes and widgets | ||
if ( opts.showAsModal ) { | ||
$( '<button>' ) | ||
.text( opts.i18n.modalButtonText ) | ||
.attr( 'id', 'a0LoginButton' ) | ||
.insertAfter( loginForm ) | ||
.click( function () { | ||
Lock.show(); | ||
} ); | ||
} else { | ||
Lock.show(); | ||
} | ||
}); | ||
|
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
$auth0_options = WP_Auth0_Options::Instance(); | ||
$wle = (bool) $auth0_options->get( 'wordpress_login_enabled', true ); | ||
?> | ||
<div id="form-signin-wrapper" class="auth0-login"> | ||
<div class="form-signin"> | ||
<div id="<?php echo esc_attr( WPA0_AUTH0_LOGIN_FORM_ID ) ?>"></div> | ||
<?php if ( $wle && function_exists( 'login_header' ) ) : ?> | ||
<div id="extra-options"> | ||
<a href="<?php echo wp_login_url() ?>?wle"> | ||
<?php _e( 'Login with WordPress username', 'wp-auth0' ) ?> | ||
</a> | ||
</div> | ||
<?php endif ?> | ||
</div> | ||
</div> | ||
|
||
<style type="text/css"> | ||
<?php echo apply_filters( 'auth0_login_css', '' ) ?> | ||
<?php echo $auth0_options->get( 'custom_css' ) ?> | ||
</style> | ||
|
||
<?php if ( $custom_js = $auth0_options->get( 'custom_js' ) ) : ?> | ||
<script type="text/javascript"> | ||
document.addEventListener('DOMContentLoaded', function() { <?php echo $custom_js ?> }); | ||
</script> | ||
<?php endif ?> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.