Skip to content

Commit 53e1a46

Browse files
committed
chore: fix on empty tenant
1 parent 34ffe6f commit 53e1a46

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

app/libs/Auth/SocialLoginProviders.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,16 @@ public static function buildSupportedProviders(string $provided_tenant = ''): ar
6969
continue;
7070
}
7171

72-
// If no tenant param was provided, any enabled provider is allowed.
73-
if ($tenant === '') {
74-
$res[$provider] = ucfirst($provider);
75-
continue;
76-
}
77-
7872
// check if the 3rd party provider has defined some exclusive tenants ...
7973
$tenants = self::toList(
8074
Config::get("services.$provider.tenants", '')
8175
);
8276

77+
// If no tenant param was provided, any enabled provider is allowed.
78+
if ($tenant === '' && count($tenants)==0) {
79+
$res[$provider] = ucfirst($provider);
80+
continue;
81+
}
8382
Log::debug(sprintf("SocialLoginProviders::buildSupportedProviders provider %s is enabled", $provider));
8483
// 1. check if we have exclusive tenants defined at provider level
8584
if (count($tenants) > 0 && !in_array($tenant, $tenants)) {

0 commit comments

Comments
 (0)