fix: registration/login button

fix: init user registrations
This commit is contained in:
Andras Bacsai
2023-06-29 17:16:50 +02:00
parent 80af200c9f
commit fed35d9c13
3 changed files with 8 additions and 4 deletions

View File

@@ -52,6 +52,11 @@ class FortifyServiceProvider extends ServiceProvider
Fortify::loginView(function () { Fortify::loginView(function () {
$settings = InstanceSettings::get(); $settings = InstanceSettings::get();
$users = User::count();
if ($users == 0) {
// If there are no users, redirect to registration
return redirect()->route('register');
}
return view('auth.login', [ return view('auth.login', [
'is_registration_enabled' => $settings->is_registration_enabled 'is_registration_enabled' => $settings->is_registration_enabled
]); ]);

View File

@@ -97,7 +97,7 @@ a {
} }
} }
.bg-coollabs-gradient { .bg-coollabs-gradient {
@apply text-transparent bg-clip-text bg-gradient-to-r from-purple-500 via-pink-500 to-red-500; @apply text-transparent text-white bg-gradient-to-r from-purple-500 via-pink-500 to-red-500;
} }
.text-helper { .text-helper {
@apply inline-block font-bold text-warning; @apply inline-block font-bold text-warning;

View File

@@ -8,8 +8,7 @@
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<h1>{{ __('auth.login') }}</h1> <h1>{{ __('auth.login') }}</h1>
@if ($is_registration_enabled) @if ($is_registration_enabled)
<a href="/register" <a href="/register" class="text-xs normal-case hover:no-underline btn btn-sm bg-coollabs-gradient">
class="text-xs text-center text-white normal-case bg-transparent border-none rounded no-animation hover:no-underline btn btn-sm bg-coollabs-gradient">
{{ __('auth.register_now') }} {{ __('auth.register_now') }}
</a> </a>
@endif @endif
@@ -41,7 +40,7 @@
</div> </div>
@endif @endif
@if (session('status')) @if (session('status'))
<div class="mb-4 font-medium text-green-600"> <div class="mb-4 font-medium text-green-600">
{{ session('status') }} {{ session('status') }}
</div> </div>
@endif @endif