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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user