Skip to content

Commit 44833c6

Browse files
committed
add skiped OPTION auth
1 parent 4111829 commit 44833c6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

rest/controllers/PostController.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,16 @@ public function actions()
1717
public $authMethods = [
1818
'yii\rest\HttpBasicAuth',
1919
];
20+
21+
/**
22+
* @inheritdoc
23+
*/
24+
protected function authenticate($action)
25+
{
26+
if (empty($this->authMethods) || $action->id == "options") {
27+
return;
28+
}
29+
30+
parent::authenticate($action);
31+
}
2032
}

0 commit comments

Comments
 (0)