Skip to content

Instantly share code, notes, and snippets.

@justingreerbbi
Created November 14, 2019 23:07
Show Gist options
  • Save justingreerbbi/d1d7e6af47796a9ff2a647fcc3cc1108 to your computer and use it in GitHub Desktop.
Save justingreerbbi/d1d7e6af47796a9ff2a647fcc3cc1108 to your computer and use it in GitHub Desktop.
User Redirect after login to WordPress REST API
/**
* This can be used in conjuction https://gist.github.com/justingreerbbi/768f1effcca69b4098c9d0f7731deba0
* This code would go on the WP side.
*/
add_action('clear_auth_cookie', 'wp_oaut_server_logout_user_rediect_to_client_rest_api_endpoint');
function wp_oaut_server_logout_user_rediect_to_client_rest_api_endpoint(){
wp_redirect('https://site.com/wp-json/wpoauthserver/v1/logout/');
}
@justingreerbbi
Copy link
Author

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