Skip to content

Commit

Permalink
fix: func not found, rm require package
Browse files Browse the repository at this point in the history
  • Loading branch information
warcooft committed Sep 11, 2024
1 parent ff6571d commit a29f15f
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 72 deletions.
137 changes: 68 additions & 69 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,73 @@
{
"name": "datamweb/shield-oauth",
"description": "OAuth for CodeIgniter Shield",
"license": "MIT",
"type": "library",
"keywords": [
"codeigniter4",
"shield",
"oauth",
"googleOauth",
"githubOauth",
"authentication",
"authorization"
"name": "datamweb/shield-oauth",
"description": "OAuth for CodeIgniter Shield",
"license": "MIT",
"type": "library",
"keywords": [
"codeigniter4",
"shield",
"oauth",
"googleOauth",
"githubOauth",
"authentication",
"authorization"
],
"authors": [
{
"name": "Pooya Parsa Dadashi",
"email": "[email protected]",
"role": "Developer"
}
],
"homepage": "https://github.com/datamweb/shield-oauth",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^7.4.3 || ^8.0 || ^8.1 || ^8.2",
"ext-curl": "*",
"codeigniter4/shield": "^1.0"
},
"require-dev": {
"codeigniter4/devkit": "^1.0",
"codeigniter4/framework": "^4.3.5",
"codeigniter4/shield": "^1.0",
"rector/rector": "1.2.5"
},
"autoload": {
"psr-4": {
"Datamweb\\ShieldOAuth\\": "src"
},
"exclude-from-classmap": [
"**/Database/Migrations/**"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests",
"Tests\\Support\\": "tests/_support"
}
},
"scripts": {
"post-update-cmd": [
"bash admin/setup.sh"
],
"authors": [
{
"name": "Pooya Parsa Dadashi",
"email": "[email protected]",
"role": "Developer"
}
"ci": [
"Composer\\Config::disableProcessTimeout",
"@cs"
],
"homepage": "https://github.com/datamweb/shield-oauth",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^7.4.3 || ^8.0 || ^8.1 || ^8.2",
"ext-curl": "*",
"codeigniter4/shield": "^1.0",
"codeigniter4/settings": "^2.2"
},
"require-dev": {
"codeigniter4/devkit": "^1.0",
"codeigniter4/framework": "^4.3.5",
"codeigniter4/shield": "^1.0",
"rector/rector": "1.2.5"
},
"autoload": {
"psr-4": {
"Datamweb\\ShieldOAuth\\": "src"
},
"exclude-from-classmap": [
"**/Database/Migrations/**"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests",
"Tests\\Support\\": "tests/_support"
}
},
"scripts": {
"post-update-cmd": [
"bash admin/setup.sh"
],
"ci": [
"Composer\\Config::disableProcessTimeout",
"@cs"
],
"cs": "php-cs-fixer fix --ansi --verbose --dry-run --diff",
"cs-fix": "php-cs-fixer fix --ansi --verbose --diff",
"style": "@cs-fix"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
},
"support": {
"forum": "https://github.com/datamweb/shield-oauth/discussions",
"source": "https://github.com/datamweb/shield-oauth",
"issues": "https://github.com/datamweb/shield-oauth/issues",
"docs": "https://www.shield-oauth.codeigniter4.ir"
"cs": "php-cs-fixer fix --ansi --verbose --dry-run --diff",
"cs-fix": "php-cs-fixer fix --ansi --verbose --diff",
"style": "@cs-fix"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
},
"support": {
"forum": "https://github.com/datamweb/shield-oauth/discussions",
"source": "https://github.com/datamweb/shield-oauth",
"issues": "https://github.com/datamweb/shield-oauth/issues",
"docs": "https://www.shield-oauth.codeigniter4.ir"
}
}
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ parameters:
- Faker\Generator
scanDirectories:
- vendor/codeigniter4/framework/system/Helpers
- vendor/codeigniter4/settings/src/Helpers
dynamicConstantNames:
- APP_NAMESPACE
- CI_DEBUG
Expand Down
3 changes: 0 additions & 3 deletions src/Controllers/OAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ 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 @@ -94,7 +93,6 @@ 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 @@ -166,7 +164,6 @@ 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 a29f15f

Please sign in to comment.