Created
November 1, 2019 22:28
-
-
Save joshcanhelp/e175e67198f8a18ae72874e1920fe167 to your computer and use it in GitHub Desktop.
Add another callback URL to the WP-Auth0 plugin
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
<?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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure to update your Auth0 Application with the new callback URL:
... and save the wp-admin > Settings > Permalinks page in WordPress once the code is in place to clear the rewrite cache.