2026-01-20 19:53:54 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
use App\Http\Controllers\Auth\AcceptInviteController;
|
|
|
|
|
use App\Http\Controllers\Auth\AuthenticatedSessionController;
|
|
|
|
|
use App\Http\Controllers\Auth\EmailVerificationNotificationController;
|
|
|
|
|
use App\Http\Controllers\Auth\EmailVerificationPromptController;
|
2026-05-04 21:42:25 +00:00
|
|
|
use App\Http\Controllers\Auth\GitHubController;
|
|
|
|
|
use App\Http\Controllers\Auth\GoogleController;
|
2026-01-20 19:53:54 +00:00
|
|
|
use App\Http\Controllers\Auth\NewPasswordController;
|
|
|
|
|
use App\Http\Controllers\Auth\PasswordResetLinkController;
|
|
|
|
|
use App\Http\Controllers\Auth\RegisteredUserController;
|
2026-03-31 00:32:43 +00:00
|
|
|
use App\Http\Controllers\Auth\SignupSuccessController;
|
2026-01-20 19:53:54 +00:00
|
|
|
use App\Http\Controllers\Auth\VerifyEmailController;
|
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
2026-03-31 14:35:49 +00:00
|
|
|
Route::get('/invites/{invite}', [AcceptInviteController::class, 'show'])->name('app.invites.show');
|
2026-01-20 19:53:54 +00:00
|
|
|
|
2026-03-31 14:35:49 +00:00
|
|
|
Route::middleware(['guest'])->group(function () {
|
2026-05-19 14:45:16 +00:00
|
|
|
Route::middleware('registration.enabled')->group(function () {
|
|
|
|
|
Route::get('/register', [RegisteredUserController::class, 'create'])->name('register');
|
|
|
|
|
Route::post('/register', [RegisteredUserController::class, 'store'])->name('register.store');
|
|
|
|
|
});
|
2026-01-20 19:53:54 +00:00
|
|
|
|
2026-03-31 14:35:49 +00:00
|
|
|
Route::get('/login', [AuthenticatedSessionController::class, 'create'])->name('login');
|
|
|
|
|
Route::post('/login', [AuthenticatedSessionController::class, 'store'])->name('login.store');
|
2026-01-20 19:53:54 +00:00
|
|
|
|
2026-03-31 14:35:49 +00:00
|
|
|
Route::get('/forgot-password', [PasswordResetLinkController::class, 'create'])->name('password.request');
|
|
|
|
|
Route::post('/forgot-password', [PasswordResetLinkController::class, 'store'])->name('password.email');
|
2026-01-20 19:53:54 +00:00
|
|
|
|
2026-03-31 14:35:49 +00:00
|
|
|
Route::get('/reset-password/{token}', [NewPasswordController::class, 'create'])->name('password.reset');
|
|
|
|
|
Route::post('/reset-password', [NewPasswordController::class, 'store'])->name('password.store');
|
2026-03-31 00:18:07 +00:00
|
|
|
|
2026-05-04 21:42:25 +00:00
|
|
|
Route::get('/auth/google/redirect', [GoogleController::class, 'redirect'])->name('auth.google.redirect');
|
|
|
|
|
Route::get('/auth/github/redirect', [GitHubController::class, 'redirect'])->name('auth.github.redirect');
|
2026-03-31 14:35:49 +00:00
|
|
|
});
|
2026-01-20 19:53:54 +00:00
|
|
|
|
2026-05-04 22:42:13 +00:00
|
|
|
// Callbacks must be reachable by both guests (signup/login) and authenticated
|
|
|
|
|
// users (connect-from-settings). The redirect routes that initiate the OAuth
|
|
|
|
|
// round-trip enforce the right middleware, so the callback can safely branch
|
|
|
|
|
// on `Auth::check()` to dispatch to the matching flow.
|
|
|
|
|
Route::get('/auth/google/callback', [GoogleController::class, 'callback'])->name('auth.google.callback');
|
|
|
|
|
Route::get('/auth/github/callback', [GitHubController::class, 'callback'])->name('auth.github.callback');
|
|
|
|
|
|
2026-03-31 14:35:49 +00:00
|
|
|
Route::middleware(['auth'])->group(function () {
|
|
|
|
|
Route::get('/register/success', SignupSuccessController::class)->name('register.success');
|
2026-03-31 00:32:43 +00:00
|
|
|
|
2026-03-31 14:35:49 +00:00
|
|
|
Route::get('/verify-email', EmailVerificationPromptController::class)->name('verification.notice');
|
2026-01-20 19:53:54 +00:00
|
|
|
|
2026-03-31 14:35:49 +00:00
|
|
|
Route::get('/verify-email/{id}/{hash}', VerifyEmailController::class)
|
|
|
|
|
->middleware(['signed', 'throttle:6,1'])
|
|
|
|
|
->name('verification.verify');
|
2026-01-20 19:53:54 +00:00
|
|
|
|
2026-03-31 14:35:49 +00:00
|
|
|
Route::post('/email/verification-notification', [EmailVerificationNotificationController::class, 'store'])
|
|
|
|
|
->middleware('throttle:6,1')
|
|
|
|
|
->name('verification.send');
|
2026-03-29 22:24:28 +00:00
|
|
|
|
2026-03-31 14:35:49 +00:00
|
|
|
Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])->name('logout');
|
2026-03-29 22:24:28 +00:00
|
|
|
|
2026-03-31 14:35:49 +00:00
|
|
|
Route::post('/invites/{invite}/accept', [AcceptInviteController::class, 'accept'])->name('app.invites.accept');
|
|
|
|
|
Route::post('/invites/{invite}/decline', [AcceptInviteController::class, 'decline'])->name('app.invites.decline');
|
|
|
|
|
});
|