Files
hado/core/routes/web.php

43 lines
2.1 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
use App\Http\Controllers\ActionController;
use App\Http\Controllers\InboxController;
use App\Http\Controllers\Me\ChannelsController;
use App\Http\Controllers\Me\EventsController as MeEvents;
use App\Http\Controllers\Me\ProfileController;
use App\Http\Controllers\TelegramWebhookController;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Foundation\Http\Middleware\PreventRequestForgery;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\Support\Facades\Route;
use Illuminate\View\Middleware\ShareErrorsFromSession;
// Публичные: без SSO, без CSRF (см. bootstrap/app.php), без сессии
Route::withoutMiddleware([
StartSession::class,
ShareErrorsFromSession::class,
AddQueuedCookiesToResponse::class,
PreventRequestForgery::class,
])->middleware('throttle:60,1')->group(function () {
Route::post('/a/{token}/ack', [ActionController::class, 'ack'])->name('action.ack');
Route::post('/a/{token}/done', [ActionController::class, 'done'])->name('action.done');
Route::post('/hooks/telegram', TelegramWebhookController::class);
});
// Под SSO хаба
Route::middleware('remote.user')->group(function () {
Route::get('/', InboxController::class);
Route::get('/me', [ProfileController::class, 'show']);
Route::patch('/me', [ProfileController::class, 'update']);
Route::post('/me/heartbeat', [ProfileController::class, 'heartbeat']);
Route::get('/me/events', [MeEvents::class, 'index']);
Route::post('/me/events', [MeEvents::class, 'store']);
Route::post('/me/events/{event}/ack', [MeEvents::class, 'ack']);
Route::post('/me/events/{event}/done', [MeEvents::class, 'done']);
Route::get('/me/archive', [MeEvents::class, 'archive']);
Route::get('/me/channels', [ChannelsController::class, 'index']);
Route::post('/me/channels', [ChannelsController::class, 'store']);
Route::delete('/me/channels/{channel}', [ChannelsController::class, 'destroy'])->whereNumber('channel');
Route::post('/me/channels/telegram/link', [ChannelsController::class, 'telegramLink']);
});