diff --git a/routes/web.php b/routes/web.php
index 71d04297..92691ee3 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -20,17 +20,23 @@
Route::get('users', [\App\Http\Controllers\UserController::class, 'index'])->name('users.index');
// Task: profile functionality should be available only for logged-in users
-Route::get('profile', [\App\Http\Controllers\ProfileController::class, 'show'])->name('profile.show');
-Route::put('profile', [\App\Http\Controllers\ProfileController::class, 'update'])->name('profile.update');
+Route::middleware(['auth'])->group(function () {
+ Route::get('profile', [\App\Http\Controllers\ProfileController::class, 'show'])->name('profile.show');
+ Route::put('profile', [\App\Http\Controllers\ProfileController::class, 'update'])->name('profile.update');
+});
// Task: this "/secretpage" URL should be visible only for those who VERIFIED their email
// Add some middleware here, and change some code in app/Models/User.php to enable this
-Route::view('/secretpage', 'secretpage')
- ->name('secretpage');
+Route::middleware(['auth', 'verified'])->group(function () {
+ Route::view('/secretpage', 'secretpage')
+ ->name('secretpage');
+});
// Task: this "/verysecretpage" URL should ask user for verifying their password once again
// You need to add some middleware here
-Route::view('/verysecretpage', 'verysecretpage')
- ->name('verysecretpage');
+Route::middleware(['auth', 'password.confirm'])->group(function () {
+ Route::view('/verysecretpage', 'verysecretpage')
+ ->name('verysecretpage');
+});
-require __DIR__.'/auth.php';
+require __DIR__ . '/auth.php';