feat: implement user session management with Redis and add game token verification

This commit is contained in:
2025-12-30 01:55:40 +00:00
parent 29523ef22f
commit f01a21f2f0
28 changed files with 477 additions and 27 deletions
+5
View File
@@ -1,3 +1,5 @@
import type { GameSessionTokenPayload } from '@sammo-ts/common/auth/gameToken.js';
import type { TurnDaemonTransport } from './daemon/transport.js';
export interface GameProfile {
@@ -26,16 +28,19 @@ export interface GameApiContext {
db: DatabaseClient;
turnDaemon: TurnDaemonTransport;
profile: GameProfile;
auth: GameSessionTokenPayload | null;
}
export const createGameApiContext = (options: {
db: DatabaseClient;
turnDaemon: TurnDaemonTransport;
profile: GameProfile;
auth: GameSessionTokenPayload | null;
}): GameApiContext => {
return {
db: options.db,
turnDaemon: options.turnDaemon,
profile: options.profile,
auth: options.auth,
};
};