Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Returns the user's email if the account is not found. #133

Merged
merged 3 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Controllers/OAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function callBack(): RedirectResponse
if ($this->checkExistenceUser($find) === false) {
// Check config setting first to see if it can register automatically or not
if (config('ShieldOAuthConfig')->oauthConfigs[$oauthName]['allow_register'] === false) {
return redirect()->to(config('Auth')->logoutRedirect())->with('error', lang('ShieldOAuthLang.Callback.account_not_found'));
return redirect()->to(config('Auth')->logoutRedirect())->with('error', lang('ShieldOAuthLang.Callback.account_not_found', [$userInfo->email]));
}

helper('text');
Expand Down
2 changes: 1 addition & 1 deletion src/Language/en/ShieldOAuthLang.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'Callback' => [
'oauth_class_not_set' => 'An error occurred, it seems that the OAuth Class is not set.',
'anti_forgery' => 'Your request has been detected as fake. we are sorry!',
'account_not_found' => 'Your account not found. Please register first!',
'account_not_found' => 'There is no account registered with the email "{0}".',
],

// ShieldOAuthButton in views
Expand Down
2 changes: 1 addition & 1 deletion src/Language/fa/ShieldOAuthLang.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'Callback' => [
'oauth_class_not_set' => 'خطای رخ داد، به نظر میرسد کلاس OAuth مورد نظر به درستی تنظیم نشده است.',
'anti_forgery' => 'متاسفانه، تلاش شما ، یک درخواست جعلی تشخیص داده شد.',
'account_not_found' => 'اکانت پیدا نشد. لطفا ابتدا ثبت نام کنید!',
'account_not_found' => 'هیچ حسابی با ایمیل "{0}" ثبت نشده است.',
],

// ShieldOAuthButton in views
Expand Down
2 changes: 1 addition & 1 deletion src/Language/fr/ShieldOAuthLang.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'Callback' => [
'oauth_class_not_set' => 'Une erreur s’est produite, il semble que la classe OAuth n’est pas définie.',
'anti_forgery' => 'Votre demande a été détectée comme erronée. Nous sommes désolés!',
'account_not_found' => '(To be translated) Your account not found. Please register first!',
'account_not_found' => 'Il n\'y a pas de compte enregistré avec l\'email "{0}".',
],

// ShieldOAuthButton in views
Expand Down
2 changes: 1 addition & 1 deletion src/Language/id/ShieldOAuthLang.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'Callback' => [
'oauth_class_not_set' => 'Terjadi kesalahan, sepertinya class OAuth tidak terpasang.',
'anti_forgery' => 'Maaf, permintaan Anda terdeteksi tidak valid!',
'account_not_found' => 'Akun tidak ditemukan, silakan mendaftar terlebih dahulu!',
'account_not_found' => 'Tidak ada akun yang terdaftar dengan email "{0}".',
],

// ShieldOAuthButton in views
Expand Down
Loading