chore: Update registration view to display a notice for first user that it will be an admin

This commit is contained in:
Andras Bacsai
2024-08-06 11:34:51 +02:00
parent 22f04e4708
commit 0ce41d2c1c
2 changed files with 15 additions and 4 deletions

View File

@@ -44,6 +44,8 @@ class FortifyServiceProvider extends ServiceProvider
{
Fortify::createUsersUsing(CreateNewUser::class);
Fortify::registerView(function () {
$isFirstUser = User::count() === 0;
$settings = \App\Models\InstanceSettings::get();
if (! $settings->is_registration_enabled) {
return redirect()->route('login');
@@ -51,7 +53,9 @@ class FortifyServiceProvider extends ServiceProvider
if (config('coolify.waitlist')) {
return redirect()->route('waitlist.index');
} else {
return view('auth.register');
return view('auth.register', [
'isFirstUser' => $isFirstUser,
]);
}
});