mirror of
https://github.com/elyby/accounts.git
synced 2024-11-09 23:12:20 +05:30
Обновлены роуты для oAuth2 запросов по последней спеке
This commit is contained in:
parent
31679b84cb
commit
c25bfeb8bc
@ -3,4 +3,6 @@ return [
|
||||
'/accounts/change-email/initialize' => 'accounts/change-email-initialize',
|
||||
'/accounts/change-email/submit-new-email' => 'accounts/change-email-submit-new-email',
|
||||
'/accounts/change-email/confirm-new-email' => 'accounts/change-email-confirm-new-email',
|
||||
|
||||
'/oauth2/v1/<action>' => 'oauth/<action>',
|
||||
];
|
||||
|
@ -16,13 +16,13 @@ class OauthController extends Controller {
|
||||
public function behaviors() {
|
||||
return ArrayHelper::merge(parent::behaviors(), [
|
||||
'authenticator' => [
|
||||
'except' => ['validate', 'issue-token'],
|
||||
'except' => ['validate', 'token'],
|
||||
],
|
||||
'access' => [
|
||||
'class' => AccessControl::class,
|
||||
'rules' => [
|
||||
[
|
||||
'actions' => ['validate', 'issue-token'],
|
||||
'actions' => ['validate', 'token'],
|
||||
'allow' => true,
|
||||
'roles' => ['?'],
|
||||
],
|
||||
@ -38,9 +38,9 @@ class OauthController extends Controller {
|
||||
|
||||
public function verbs() {
|
||||
return [
|
||||
'validate' => ['GET'],
|
||||
'complete' => ['POST'],
|
||||
'issue-token' => ['POST'],
|
||||
'validate' => ['GET'],
|
||||
'complete' => ['POST'],
|
||||
'token' => ['POST'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ class OauthController extends Controller {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function actionIssueToken() {
|
||||
public function actionToken() {
|
||||
$this->attachRefreshTokenGrantIfNeedle();
|
||||
try {
|
||||
$response = $this->getServer()->issueAccessToken();
|
||||
|
@ -9,17 +9,17 @@ use yii\codeception\BasePage;
|
||||
class OauthRoute extends BasePage {
|
||||
|
||||
public function validate($queryParams) {
|
||||
$this->route = ['oauth/validate'];
|
||||
$this->route = '/oauth2/v1/validate';
|
||||
$this->actor->sendGET($this->getUrl($queryParams));
|
||||
}
|
||||
|
||||
public function complete($queryParams = [], $postParams = []) {
|
||||
$this->route = ['oauth/complete'];
|
||||
$this->route = '/oauth2/v1/complete';
|
||||
$this->actor->sendPOST($this->getUrl($queryParams), $postParams);
|
||||
}
|
||||
|
||||
public function issueToken($postParams = []) {
|
||||
$this->route = ['oauth/issue-token'];
|
||||
$this->route = '/oauth2/v1/token';
|
||||
$this->actor->sendPOST($this->getUrl(), $postParams);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user