<?php

use customerapi\components\JwtValidationData;
use sizeg\jwt\Jwt;

$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-customerapi',
	'name' =>'Fitness recepció',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'customerapi\controllers',
    'components' => [
    	'request' => [
    		'enableCsrfValidation'=>false,
            'csrfParam' => '_csrf-customerapi',
            'parsers' => [
                'application/json' => 'yii\web\JsonParser',
            ]
    	],
        'user' => [
            'identityClass' => 'common\models\Customer',
            'enableSession' => false,
            'enableAutoLogin' => false,
            'loginUrl' => null,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'jwt' => [
            'class' => Jwt::class,
            'key' => 'Ability is nothing without opportunity',
            // You have to configure ValidationData informing all claims you want to validate the token.
            'jwtValidationData' => JwtValidationData::class,
        ],
    ],
    'params' => $params,
];
