Require revocable authorization for automatic lobby removal
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { json } from '@sveltejs/kit';
|
||||
import { authenticateAgent, hostApiError, objectBody } from '$lib/server/hosts/http.js';
|
||||
import { claimRemovalAuthorization } from '$lib/server/autoscaling/authorization.js';
|
||||
|
||||
export async function POST({ request, params }: { request: Request; params: { id: string } }) {
|
||||
const host = authenticateAgent(request);
|
||||
try { return json(claimRemovalAuthorization(host.id, params.id, await objectBody(request, 4096))); }
|
||||
catch (cause) { return hostApiError(cause); }
|
||||
}
|
||||
Reference in New Issue
Block a user