Skip to content

Instantly share code, notes, and snippets.

@justingreerbbi
Created November 30, 2015 14:41
Show Gist options
  • Save justingreerbbi/4ead582007ebdb55075c to your computer and use it in GitHub Desktop.
Save justingreerbbi/4ead582007ebdb55075c to your computer and use it in GitHub Desktop.
Custom login redirect is user is not logged in for WP OAuth Server
function wo_before_authorize_function_login_redirect( $request ){
// Check if the user is logged in or not
if(!is_user_logged_in()){
wp_redirect( 'http://your-custom-login.com/login' );
exit;
}
// Else do nothing and let the server handle the request
}
add_action('wo_before_authorize_method', 'wo_before_authorize_function_login_redirect');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment