fix: boarding + verification

This commit is contained in:
Andras Bacsai 2023-10-11 14:24:19 +02:00
parent 3e4538de98
commit 62adf2c5dc
4 changed files with 14 additions and 5 deletions

View File

@ -12,6 +12,9 @@ class DecideWhatToDoWithUser
public function handle(Request $request, Closure $next): Response
{
if (!auth()->user() || !isCloud() || isInstanceAdmin()) {
if (!isCloud() && showBoarding() && !in_array($request->path(), allowedPathsForBoardingAccounts())) {
return redirect('boarding');
}
return $next($request);
}
if (!auth()->user()->hasVerifiedEmail()) {

View File

@ -72,7 +72,7 @@ public function sendVerificationEmail()
$mail->view('emails.email-verification', [
'url' => $url,
]);
$mail->subject('Coolify Cloud: Verify your email.');
$mail->subject('Coolify: Verify your email.');
send_user_an_email($mail, $this->email);
}
public function sendPasswordResetNotification($token): void

View File

@ -14,9 +14,12 @@
<span>Your subscription has been activated! Welcome onboard!</span>
</div>
@endif
<h3 class="pb-4">Projects</h3>
@if ($projects->count() === 0 && $servers->count() === 0)
No resources found. Add your first server / private key <a class="text-white underline" href="{{route('server.create')}}">here</a>.
@endif
@if ($projects->count() > 0)
<h3 class="pb-4">Projects</h3>
@endif
@if ($projects->count() === 1)
<div class="grid grid-cols-1 gap-2">
@else
@ -58,7 +61,9 @@
</div>
@endforeach
</div>
<h3 class="py-4">Servers</h3>
@if ($projects->count() > 0)
<h3 class="pb-4">Servers</h3>
@endif
@if ($servers->count() === 1)
<div class="grid grid-cols-1 gap-2">
@else

View File

@ -73,6 +73,7 @@
Route::get('/email/verify/{id}/{hash}', function (EmailVerificationRequest $request) {
$request->fulfill();
send_internal_notification("User {$request->user()->name} verified their email address.");
return redirect('/');
})->middleware(['auth'])->name('verify.verify');