Skip to content

Instantly share code, notes, and snippets.

@joshcanhelp
Created November 1, 2019 22:28
Show Gist options
  • Save joshcanhelp/e175e67198f8a18ae72874e1920fe167 to your computer and use it in GitHub Desktop.
Save joshcanhelp/e175e67198f8a18ae72874e1920fe167 to your computer and use it in GitHub Desktop.
Add another callback URL to the WP-Auth0 plugin
<?php
function namespace_add_auth0_callback_rewrite() {
add_rewrite_rule('^auth0/callback$', 'index.php?auth0=1', 'top');
}
add_action('init', 'namespace_add_auth0_callback_rewrite');
function namespace_add_auth0_callback_param( $params ) {
$params['redirect_uri'] = home_url( '/auth0/callback' );
return $params;
}
add_filter( 'auth0_authorize_url_params', 'namespace_add_auth0_callback_param' );
@joshcanhelp
Copy link
Author

joshcanhelp commented Nov 1, 2019

Make sure to update your Auth0 Application with the new callback URL:

Screenshot 2019-11-01 15 28 59

... and save the wp-admin > Settings > Permalinks page in WordPress once the code is in place to clear the rewrite cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment