mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Огромный рефакторинг в пользу отказа от механизма environment и использования .env файла
Найдено и удалено немного мусора
This commit is contained in:
@@ -25,6 +25,7 @@ class SessionController extends ApiController {
|
||||
$behaviors['rateLimiting'] = [
|
||||
'class' => RateLimiter::class,
|
||||
'only' => ['has-joined', 'has-joined-legacy'],
|
||||
'authserverDomain' => getenv('AUTHSERVER_HOST'),
|
||||
];
|
||||
|
||||
return $behaviors;
|
||||
|
@@ -18,10 +18,6 @@ class RateLimiter extends \yii\filters\RateLimiter {
|
||||
|
||||
public function init() {
|
||||
parent::init();
|
||||
if ($this->authserverDomain === null) {
|
||||
$this->authserverDomain = Yii::$app->params['authserverDomain'] ?? null;
|
||||
}
|
||||
|
||||
if ($this->authserverDomain === null) {
|
||||
throw new InvalidConfigException('authserverDomain param is required');
|
||||
}
|
||||
@@ -45,6 +41,7 @@ class RateLimiter extends \yii\filters\RateLimiter {
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function checkRateLimit($user, $request, $response, $action) {
|
||||
// TODO: теперь в authserverDomain хранится hostname без schema, а getHostInfo() возвращает с http(s).
|
||||
if ($request->getHostInfo() === $this->authserverDomain) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user