Created
November 30, 2015 14:41
-
-
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
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
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