step 1, 2 and 3 of the implementation plan
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Http\Controllers\Auth\SocialiteController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Inertia\Inertia;
|
||||
|
||||
Route::get('/', function () {
|
||||
return view('welcome');
|
||||
});
|
||||
Route::get('/', fn () => Inertia::render('Landing'))->name('landing');
|
||||
|
||||
// Authentication routes
|
||||
Route::get('/login', [SocialiteController::class, 'redirect'])->name('login');
|
||||
Route::get('/auth/callback', [SocialiteController::class, 'callback']);
|
||||
Route::post('/logout', [SocialiteController::class, 'logout'])->name('logout')->middleware('auth');
|
||||
|
||||
// Dev auto-login route
|
||||
if (app()->environment('local', 'testing')) {
|
||||
Route::get('/login-jonathan', function () {
|
||||
$user = \App\Models\User::where('email', 'jonathan@blijnder.nl')->first();
|
||||
@@ -17,6 +25,6 @@
|
||||
|
||||
auth()->login($user);
|
||||
|
||||
return redirect('/cp');
|
||||
return redirect('/');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user