Skip to content

Commit 82724e7

Browse files
committed
add configuration option for guard
1 parent e0e9eae commit 82724e7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

routes/inertia.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
Route::get('/privacy-policy', [PrivacyPolicyController::class, 'show'])->name('policy.show');
2121
}
2222

23-
Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
23+
$authMiddleware = config('jetstream.guard')
24+
? 'auth:'.config('jetstream.guard')
25+
: 'auth';
26+
27+
Route::group(['middleware' => [$authMiddleware, 'verified']], function () {
2428
// User & Profile...
2529
Route::get('/user/profile', [UserProfileController::class, 'show'])
2630
->name('profile.show');

routes/livewire.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
Route::get('/privacy-policy', [PrivacyPolicyController::class, 'show'])->name('policy.show');
1717
}
1818

19-
Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
19+
$authMiddleware = config('jetstream.guard')
20+
? 'auth:'.config('jetstream.guard')
21+
: 'auth';
22+
23+
Route::group(['middleware' => [$authMiddleware, 'verified']], function () {
2024
// User & Profile...
2125
Route::get('/user/profile', [UserProfileController::class, 'show'])
2226
->name('profile.show');

0 commit comments

Comments
 (0)