Skip to content

Commit

Permalink
fix: add phpstan-ignore for setting func
Browse files Browse the repository at this point in the history
  • Loading branch information
warcooft committed Sep 10, 2024
1 parent f058fd7 commit ff6571d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Controllers/OAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function redirectOAuth(string $oauthName): RedirectResponse
return redirect()->to(config('Auth')->loginRedirect());
}

/** @phpstan-ignore-next-line */
if (setting('ShieldOAuthConfig.oauthConfigs')[$oauthName]['allow_login'] === false) {
$errorText = 'ShieldOAuthLang.' . ucfirst($oauthName) . '.not_allow';

Expand Down Expand Up @@ -93,6 +94,7 @@ public function callBack(): RedirectResponse
$userid = $this->syncingUserInfo($find, $updateFields);
} else {
// Check config setting first to see if it can register automatically or not
/** @phpstan-ignore-next-line */
if (setting('ShieldOAuthConfig.oauthConfigs')[$oauthName]['allow_register'] === false) {
return redirect()->to(config('Auth')->logoutRedirect())->with('error', lang('ShieldOAuthLang.Callback.account_not_found', [$userInfo->email]));
}
Expand Down Expand Up @@ -164,6 +166,7 @@ private function syncingUserInfo(array $find = [], array $updateFields = []): in
$users = model('ShieldOAuthModel');
$user = $users->findByCredentials($find);

/** @phpstan-ignore-next-line */
if (setting('ShieldOAuthConfig.syncingUserInfo') === true) {
$user->fill($updateFields);
}
Expand Down

0 comments on commit ff6571d

Please sign in to comment.