profile test passes now

This commit is contained in:
2025-03-27 13:40:25 +00:00
parent a9b69d1a0e
commit a4f2dcf7fd
3 changed files with 34 additions and 1 deletions

View File

@@ -51,6 +51,14 @@ class ProfileController extends Controller
$user = $request->user();
if ($user->ownedOrganisations()->count()) {
return back()->withErrors(['password' => __('You must delete or transfer your organisations before you can delete your account.')]);
}
if ($user->organisations()->count()) {
return back()->withErrors(['password' => __('You must leave your organisations before you can delete your account.')]);
}
Auth::logout();
$user->delete();