Add embeddable slides and pause mode
Every slide gets an embed URL /e/{key}/{id} for presentation software
like Canva. The page goes live while it is visible, keeps itself live
with heartbeats and pauses when it disappears; stale embeds are paused
lazily. The embed key is separate from the admin token and only allows
showing, activating, pausing and voting controls of that slide.
Participants see a pause page while no slide is live. The presenter
can pause (P) and resume the paused slide with the arrow keys; the
dashboard has a pause button.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
58145e9753
commit
07a292d109
19 files changed
+1116
-68
No files matched your search
+9
-2
@@ -29,6 +29,7 @@ use Cake\Http\MiddlewareQueue;
|
||||
use Cake\ORM\Locator\TableLocator;
|
||||
use Cake\Routing\Middleware\AssetMiddleware;
|
||||
use Cake\Routing\Middleware\RoutingMiddleware;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* Application setup class.
|
||||
@@ -93,9 +94,15 @@ class Application extends BaseApplication
|
||||
|
||||
// Cross Site Request Forgery (CSRF) Protection Middleware
|
||||
// https://book.cakephp.org/5/en/security/csrf.html#cross-site-request-forgery-csrf-middleware
|
||||
->add(new CsrfProtectionMiddleware([
|
||||
->add((new CsrfProtectionMiddleware([
|
||||
'httponly' => true,
|
||||
]));
|
||||
]))->skipCheckCallback(
|
||||
// Embedded slides run in third-party iframes (no cookies); the secret key is the authorisation.
|
||||
fn(ServerRequestInterface $request): bool => (bool)preg_match(
|
||||
'/^embed(:|$)/',
|
||||
(string)($request->getAttribute('params')['_name'] ?? ''),
|
||||
),
|
||||
));
|
||||
|
||||
return $middlewareQueue;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user