Skip to content

Commit 074edb7

Browse files
committed
Merge branch 'replace_login_with_fortify' into replace_email_verification_with_fortify
# Conflicts: # app/Providers/FortifyServiceProvider.php
2 parents 4c879d7 + 7aa0ce0 commit 074edb7

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

app/Providers/FortifyServiceProvider.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
use Illuminate\Cache\RateLimiting\Limit;
66
use Illuminate\Http\Request;
77
use Illuminate\Support\Facades\RateLimiter;
8-
use Illuminate\Support\Facades\Route;
98
use Illuminate\Support\ServiceProvider;
109
use Illuminate\Support\Str;
1110
use Inertia\Inertia;
11+
use Laravel\Fortify\Features;
1212
use Laravel\Fortify\Fortify;
1313

1414
class FortifyServiceProvider extends ServiceProvider
@@ -25,9 +25,19 @@ public function register(): void
2525
* Bootstrap any application services.
2626
*/
2727
public function boot(): void
28+
{
29+
$this->configureViews();
30+
$this->configureRateLimiting();
31+
}
32+
33+
/**
34+
* Configure Fortify views.
35+
*/
36+
private function configureViews(): void
2837
{
2938
Fortify::loginView(fn (Request $request) => Inertia::render('auth/Login', [
30-
'canResetPassword' => Route::has('password.request'),
39+
'canResetPassword' => Features::enabled(Features::resetPasswords()),
40+
'canRegister' => Features::enabled(Features::registration()),
3141
'status' => $request->session()->get('status'),
3242
]));
3343

@@ -38,7 +48,13 @@ public function boot(): void
3848
Fortify::twoFactorChallengeView(fn () => Inertia::render('auth/TwoFactorChallenge'));
3949

4050
Fortify::confirmPasswordView(fn () => Inertia::render('auth/ConfirmPassword'));
51+
}
4152

53+
/**
54+
* Configure rate limiting.
55+
*/
56+
private function configureRateLimiting(): void
57+
{
4258
RateLimiter::for('two-factor', function (Request $request) {
4359
return Limit::perMinute(5)->by($request->session()->get('login.id'));
4460
});

0 commit comments

Comments
 (0)