<?php 

use yii\grid\GridView;
use yii\data\ArrayDataProvider;
/**
 * @var yii\web\View $this
 * @var \backend\models\User $model
 */
?>
<?php if (Yii::$app->getModule('oauth2')){ ?>
    <h2>Secrets</h2>
    <?= GridView::widget([
        'dataProvider' => new ArrayDataProvider(['allModels' => [$model->oauthSecrets]]),
        'summary' => false,
        'columns' =>[
            'client_id',
            'client_secret',
            'redirect_uri',
            'grant_types',
        ],
        ])?>
    <h2>Tokens</h2>
    <?= GridView::widget([
        'dataProvider' => new ArrayDataProvider(['allModels' => $model->oauthAccessTokens]),
        'summary' => false,
        'columns' =>[
            'client_id',
            'access_token',
            'expires',
            'grant_types',
            'scope',
        ],
        ])?>
    <h2>Refresh Tokens</h2>
    <?= GridView::widget([
        'dataProvider' => new ArrayDataProvider(['allModels' => $model->oauthRefreshTokens]),
        'summary' => false,
        'columns' =>[
            'client_id',
            'refresh_token',
            'expires',
            'scope',
        ],
        ])?>

    <h2>Endpoints: </h2>
    <p> /api/admin/site/authorize </p>
    <p> /api/admin/site/token </p>
<?php } ?>