new project, start doing auth!

This commit is contained in:
2026-09-07 00:23:12 +02:00
commit fccfe8eb0b
60 changed files with 14826 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
Route::get('/user', function (Request $request) {
return $request->user();
})->middleware('auth:api');
+8
View File
@@ -0,0 +1,8 @@
<?php
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
+27
View File
@@ -0,0 +1,27 @@
<?php
use Illuminate\Support\Facades\Route;
use Laravel\Socialite\Socialite;
use App\Models\User;
Route::get('/', function () {
return view('welcome');
});
Route::get('/auth/login', function () {
return Socialite::driver('authentik')->redirect();
});
Route::get('/auth/redirect', function () {
$user = Socialite::driver('authentik')->user();
$new_user = User::updateOrCreate([
'name' => $user->nickname,
'email' => $user->email,
'oauth_token' => $user->token,
]);
Auth::login($new_user);
return view('welcome', ['user'=>$user->name]);
// $user->token
});