Preserve "next" URI by using OAuth 'state' parameter

Summary:
When a user clicks a link like /T32 and has to login, redirect them
to the resource once they've authenticated if possible. OAuth has a param
specifically for this, called 'state', so use it if possible. Facebook
supports it but Github does not.

Test Plan:
logged in with facebook after viewing /D20

Reviewed By: aran
Reviewers: aran
CC: aran, epriestley
Differential Revision: 61
This commit is contained in:
epriestley
2011-03-07 19:29:51 -08:00
parent 0bcbd0f158
commit a100d97ed5
7 changed files with 40 additions and 7 deletions

View File

@@ -21,6 +21,7 @@ abstract class PhabricatorOAuthRegistrationController
private $oauthProvider;
private $oauthInfo;
private $oauthState;
final public function setOAuthInfo($info) {
$this->oauthInfo = $info;
@@ -40,4 +41,13 @@ abstract class PhabricatorOAuthRegistrationController
return $this->oauthProvider;
}
final public function setOAuthState($state) {
$this->oauthState = $state;
return $this;
}
final public function getOAuthState() {
return $this->oauthState;
}
}