diff --git a/app/Http/Controllers/SocialController.php b/app/Http/Controllers/SocialController.php index 962700c1e..363c0faaf 100644 --- a/app/Http/Controllers/SocialController.php +++ b/app/Http/Controllers/SocialController.php @@ -188,6 +188,10 @@ public function destroyProvider(Request $request) { && !($user->socialProfile->twitter_id !== null && $user->socialProfile->mastodon_id !== null)) { return response(__('controller.social.delete-set-password'), 406); } + if ($user->email === null + && !($user->socialProfile->twitter_id !== null && $user->socialProfile->mastodon_id !== null)) { + return response(__('controller.social.delete-set-email'), 406); + } if ($user->socialProfile === null) { return response(__('controller.social.delete-never-connected'), 404); diff --git a/resources/lang/de/controller.php b/resources/lang/de/controller.php index a2dd33a4b..4e277ce4c 100644 --- a/resources/lang/de/controller.php +++ b/resources/lang/de/controller.php @@ -4,6 +4,7 @@ "already-connected-error" => "Dieser Account ist bereits mit einem anderen Nutzer verknüpft.", "create-error" => "Es gab ein Problem beim Erstellen Deines Accounts.", "delete-never-connected" => "Du hast keinen Social-Login-Provider.", + "delete-set-email" => "Bevor du einen SSO-Provider löschst, musst du eine E-Mail Adresse festlegen, um dich nicht auszusperren.", "delete-set-password" => "Bevor du einen SSO-Provider löschst, musst du ein Passwort festlegen, um dich nicht auszusperren.", "deleted" => "Die Verbindung wurde aufgehoben." ], diff --git a/resources/lang/en/controller.php b/resources/lang/en/controller.php index 0bf29179a..583cd80bf 100644 --- a/resources/lang/en/controller.php +++ b/resources/lang/en/controller.php @@ -4,6 +4,7 @@ "already-connected-error" => "This Account is already connected to another user", "create-error" => "There has been an error creating your account.", "delete-never-connected" => "Your user does not have a Social Login provider", + "delete-set-email" => "Before you delete an SSO provider, you need to set an email address so that you don't get locked out.", "delete-set-password" => "You need to set a password before deleting a SSO-Provider to prevent you from locking yourself out.", "deleted" => "Social Login Provider has been deleted" ],