Skip to content

Commit

Permalink
add configuration option for guard
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 15, 2022
1 parent e0e9eae commit 82724e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion routes/inertia.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
Route::get('/privacy-policy', [PrivacyPolicyController::class, 'show'])->name('policy.show');
}

Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
$authMiddleware = config('jetstream.guard')
? 'auth:'.config('jetstream.guard')
: 'auth';

Route::group(['middleware' => [$authMiddleware, 'verified']], function () {
// User & Profile...
Route::get('/user/profile', [UserProfileController::class, 'show'])
->name('profile.show');
Expand Down
6 changes: 5 additions & 1 deletion routes/livewire.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
Route::get('/privacy-policy', [PrivacyPolicyController::class, 'show'])->name('policy.show');
}

Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
$authMiddleware = config('jetstream.guard')
? 'auth:'.config('jetstream.guard')
: 'auth';

Route::group(['middleware' => [$authMiddleware, 'verified']], function () {
// User & Profile...
Route::get('/user/profile', [UserProfileController::class, 'show'])
->name('profile.show');
Expand Down

0 comments on commit 82724e7

Please sign in to comment.