Initial implementation of API access to clrghouz with a whoami endpoint
This commit is contained in:
parent
6284795e3b
commit
99dc13b297
@ -72,4 +72,9 @@ class UserController extends Controller
|
||||
|
||||
return view('user.link');
|
||||
}
|
||||
|
||||
public function whoami(): User
|
||||
{
|
||||
return Auth::user();
|
||||
}
|
||||
}
|
@ -13,6 +13,11 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
commands: __DIR__.'/../routes/console.php',
|
||||
health: '/up',
|
||||
)
|
||||
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
$middleware->statefulApi();
|
||||
})
|
||||
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
$middleware->appendToGroup('web', [
|
||||
AddUserToView::class,
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
use App\Http\Controllers\{DomainController,MatrixController};
|
||||
use App\Http\Controllers\{DomainController,MatrixController,UserController};
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@ -20,3 +20,6 @@ Route::get('/domain/daily',[DomainController::class,'api_daily_stats']);
|
||||
Route::any('matrix/{item}',[MatrixController::class,'webhook'])
|
||||
->where('item', '.*')
|
||||
->middleware('auth:matrix');
|
||||
|
||||
Route::get('/whoami',[UserController::class,'whoami'])
|
||||
->middleware(['auth:sanctum']);
|
Loading…
x
Reference in New Issue
Block a user