function oauth2_user_authenticate in OAuth2 Login 8
Same name in this branch
- 8 oauth2_user/oauth2_user.api.php \oauth2_user_authenticate()
- 8 oauth2_user/authenticate.inc \oauth2_user_authenticate()
Same name and namespace in other branches
- 7.2 oauth2_user/oauth2_user.api.php \oauth2_user_authenticate()
- 7.2 oauth2_user/authenticate.inc \oauth2_user_authenticate()
Authenticate the user (redirect to login). But first save the given form_state in session.
File
- oauth2_user/
oauth2_user.api.php, line 90 - Functions that can be used by other modules.
Code
function oauth2_user_authenticate($form_state, $redirection = FALSE) {
if ($redirection) {
// We are in a redirect-after-login, but login has failed or was cancelled.
// In this case we clear the session variable so that it does not keep
// redirecting.
unset($_SESSION['oauth2_user']['form_state']);
return;
}
// Save form_state.
$_SESSION['oauth2_user']['form_state'] = $form_state;
// Redirect to login.
oauth2_login();
}