group(function () { // WebAuthn Login if (get_setting('webauthn_enabled', false)) { WebAuthn::register(); } // ============================== // Under Maintenance Page // ============================== Route::view('/maintenance', 'auth.maintenance')->name('maintenance'); // {{-- Buat file resources/views/maintenance.blade.php --}} // ============================== // Register (di-redirect ke maintenance) // ============================== Route::get('register', [RegisteredUserController::class, 'create'])->name('register'); Route::post('register', [RegisteredUserController::class, 'store']); // ============================== // Login // ============================== Route::get('login', [AuthenticatedSessionController::class, 'create'])->name('login'); Route::post('login', [AuthenticatedSessionController::class, 'store']); // ============================== // 2FA Verification // ============================== Route::get('2fa', [TwoFactorController::class, 'index'])->name('2fa.index'); Route::post('2fa', [TwoFactorController::class, 'verify'])->middleware('throttle:5,1')->name('2fa.verify'); // ============================== // Forgot / Reset Password // ============================== Route::get('forgot-password', [PasswordResetLinkController::class, 'create'])->name('password.request'); Route::post('forgot-password', [PasswordResetLinkController::class, 'store'])->name('password.email'); Route::get('reset-password/{token}', [NewPasswordController::class, 'create'])->name('password.reset'); Route::post('reset-password', [NewPasswordController::class, 'store'])->name('password.store'); }); // ============================== // Authenticated Routes (Sudah Login) // ============================== Route::middleware('auth')->group(function () { // Verify Email Route::get('verify-email', EmailVerificationPromptController::class)->name('verification.notice'); Route::get('verify-email/{id}/{hash}', VerifyEmailController::class) ->middleware(['signed', 'throttle:6,1']) ->name('verification.verify'); Route::post('email/verification-notification', [EmailVerificationNotificationController::class, 'store']) ->middleware('throttle:6,1') ->name('verification.send'); // Confirm Password (Re-auth) Route::get('confirm-password', [ConfirmablePasswordController::class, 'show'])->name('password.confirm'); Route::post('confirm-password', [ConfirmablePasswordController::class, 'store']); // Update Password & Logout Route::put('password', [PasswordController::class, 'update'])->name('password.update'); Route::post('logout', [AuthenticatedSessionController::class, 'destroy'])->name('logout'); });