Skip to content

Commit

Permalink
Save OpenID redirectUrl in session
Browse files Browse the repository at this point in the history
  • Loading branch information
Nodge committed Jan 11, 2015
1 parent 6be0378 commit 7d5b41d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions EOpenIDService.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class EOpenIDService extends EAuthServiceBase implements IAuthService {
public $realm;

/**
* @var EOpenID the openid library instance.
* @var LightOpenID the openid library instance.
*/
private $auth;

Expand Down Expand Up @@ -53,7 +53,6 @@ abstract class EOpenIDService extends EAuthServiceBase implements IAuthService {
public function init($component, $options = array()) {
parent::init($component, $options);
$this->auth = Yii::app()->loid->load();
//$this->auth = new EOpenID();
}

/**
Expand All @@ -64,10 +63,12 @@ public function init($component, $options = array()) {
* @throws CHttpException
*/
public function authenticate() {

if (!empty($_REQUEST['openid_mode'])) {
switch ($_REQUEST['openid_mode']) {
case 'id_res':
try {
$this->auth->returnUrl = $this->getState('returnUrl');
if ($this->auth->validate()) {
$this->attributes['id'] = $this->auth->identity;

Expand Down Expand Up @@ -132,7 +133,7 @@ public function authenticate() {
}

$this->auth->returnUrl = Yii::app()->request->hostInfo . Yii::app()->request->url; //getting return URL

$this->setState('returnUrl', $this->auth->returnUrl);

try {
$url = $this->auth->authUrl();
Expand Down

0 comments on commit 7d5b41d

Please sign in to comment.