add provider enabled check in the redirect
This commit is contained in:
parent
b238a1ef2d
commit
d2ca803753
1 changed files with 5 additions and 0 deletions
|
@ -400,6 +400,11 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
||||||
$validateURL = new URL();
|
$validateURL = new URL();
|
||||||
$appId = $project->getAttribute('authProviders', [])[$provider . 'Appid'] ?? '';
|
$appId = $project->getAttribute('authProviders', [])[$provider . 'Appid'] ?? '';
|
||||||
$appSecret = $project->getAttribute('authProviders', [])[$provider . 'Secret'] ?? '{}';
|
$appSecret = $project->getAttribute('authProviders', [])[$provider . 'Secret'] ?? '{}';
|
||||||
|
$providerEnabled = $project->getAttribute('authProviders', [])[$provider . 'Enabled'] ?? false;
|
||||||
|
|
||||||
|
if (!$providerEnabled) {
|
||||||
|
throw new Exception(Exception::PROJECT_PROVIDER_DISABLED, 'This provider is disabled. Please enable the provider from your ' . APP_NAME . ' console to continue.');
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($appSecret) && isset($appSecret['version'])) {
|
if (!empty($appSecret) && isset($appSecret['version'])) {
|
||||||
$key = App::getEnv('_APP_OPENSSL_KEY_V' . $appSecret['version']);
|
$key = App::getEnv('_APP_OPENSSL_KEY_V' . $appSecret['version']);
|
||||||
|
|
Loading…
Reference in a new issue