Skip to content

Commit

Permalink
Providers params are no longer needed by HA 3
Browse files Browse the repository at this point in the history
  • Loading branch information
miled committed Jul 22, 2017
1 parent 857d200 commit 518ee0e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
11 changes: 7 additions & 4 deletions hybridauth/common/endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
require_once "session.php";

try {
$config = get_provider_config_from_session_storage($provider);
$params = get_provider_params_from_session_storage($provider);
if( isset( $_REQUEST['hauth_done'] ) ){
$provider = $_REQUEST['hauth_done'];
}

$hybridauth = new Hybridauth\Hybridauth($config, $params);
$config = get_provider_config_from_session_storage($provider);

$adapter = $hybridauth->authenticate( $provider );
$hybridauth = new Hybridauth\Hybridauth($config);

$adapter = $hybridauth->authenticate($provider);

$url = $config['current_page'];

Expand Down
14 changes: 0 additions & 14 deletions hybridauth/common/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,3 @@ function get_provider_config_from_session_storage($provider){

return $_SESSION['wsl:' . $provider . ':config'];
}

//

function set_provider_params_in_session_storage($provider, $params){
$provider = strtolower($provider);

$_SESSION['wsl:' . $provider . ':params'] = $config;
}

function get_provider_params_from_session_storage($provider){
$provider = strtolower($provider);

return $_SESSION['wsl:' . $provider . ':params'];
}
2 changes: 0 additions & 2 deletions hybridauth/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@
* (c) 2011-2014 Mohamed Mrassi and contributors | http://wordpress.org/extend/plugins/wordpress-social-login/
*/

if( isset( $_REQUEST['hauth_done'] ) ) $provider = $_REQUEST['hauth_done'];

require_once "common/endpoint.php";
5 changes: 1 addition & 4 deletions includes/services/wsl.authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,9 @@ function wsl_process_login_begin()
// > after that, the provider will redirect the user back to this same page (and this same line).
// > if the user is successfully connected to provider, then this time hybridauth::authenticate()
// > will just return the provider adapter
$params = apply_filters("wsl_hook_process_login_authenticate_params", array(), $provider);

set_provider_config_in_session_storage( $provider, $config );
set_provider_params_in_session_storage( $provider, $params );

$adapter = $hybridauth->authenticate( $provider, $params );
$adapter = $hybridauth->authenticate( $provider );
}

// if hybridauth fails to authenticate the user, then we display an error message
Expand Down

0 comments on commit 518ee0e

Please sign in to comment.