mirror of
				https://github.com/elyby/accounts.git
				synced 2025-05-31 14:11:46 +05:30 
			
		
		
		
	Ререализован метод для получения инфы о конфигурации API
This commit is contained in:
		@@ -3,28 +3,27 @@ namespace api\controllers;
 | 
			
		||||
 | 
			
		||||
use Yii;
 | 
			
		||||
use yii\helpers\ArrayHelper;
 | 
			
		||||
use yii\web\Response;
 | 
			
		||||
 | 
			
		||||
class OptionsController extends Controller {
 | 
			
		||||
 | 
			
		||||
    public function behaviors() {
 | 
			
		||||
        return ArrayHelper::merge(parent::behaviors(), [
 | 
			
		||||
            'authenticator' => [
 | 
			
		||||
                'except' => ['recaptcha-public-key'],
 | 
			
		||||
                'except' => ['index'],
 | 
			
		||||
            ],
 | 
			
		||||
        ]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function verbs() {
 | 
			
		||||
        return [
 | 
			
		||||
            'recaptcha-public-key' => ['GET'],
 | 
			
		||||
            'index' => ['GET'],
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function actionRecaptchaPublicKey() {
 | 
			
		||||
        Yii::$app->response->format = Response::FORMAT_RAW;
 | 
			
		||||
 | 
			
		||||
        return Yii::$app->reCaptcha->public;
 | 
			
		||||
    public function actionIndex() {
 | 
			
		||||
        return [
 | 
			
		||||
            'reCaptchaPublicKey' => Yii::$app->reCaptcha->public,
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user