CI / test (ubuntu-latest, node 22) (push) Failing after 33m10s
CI / test (ubuntu-latest, node 24) (push) Failing after 34m41s
CI / tooling (lint, imports, typecheck) (push) Failing after 36m11s
CI / test (windows-latest, node 22) (push) Canceled after 0s
CI / test (windows-latest, node 24) (push) Canceled after 0s
11 lines
467 B
JavaScript
11 lines
467 B
JavaScript
// The title integration reuses the game's existing reconnect token. No new WebSocket messages or session fields.
|
|
export const SESSION_BINDING_PREFIX = '@session/';
|
|
|
|
export function createSessionPlayerResolver(registry) {
|
|
return (req) => {
|
|
const match = /^Bearer ([a-f0-9]{32})$/i.exec(req.headers.authorization || '');
|
|
const session = match ? registry.byToken(match[1]) : null;
|
|
return session ? SESSION_BINDING_PREFIX + session.playerId : null;
|
|
};
|
|
}
|