Files
core2026/app/gateway-api/src/context.ts
T
Hide_D 0c1e27ee4a feat: integrate Kakao OAuth for user authentication and enhance user repository
- Added Kakao OAuth client implementation for handling authentication flows.
- Updated user repository to support OAuth-based user creation and retrieval.
- Introduced Redis-based session management for OAuth sessions.
- Enhanced in-memory user repository to handle OAuth user data.
- Updated environment configuration files to include new OAuth settings.
- Modified API routes to support Kakao login and registration flows.
- Added Prisma schema updates for user model to accommodate OAuth fields.
- Implemented tests for the new authentication flow and user repository methods.
2025-12-30 02:19:32 +00:00

37 lines
1.3 KiB
TypeScript

import type { GatewayFlushPublisher } from './auth/flushPublisher.js';
import type { GatewaySessionService } from './auth/sessionService.js';
import type { UserRepository } from './auth/userRepository.js';
import type { KakaoOAuthClient } from './auth/kakaoClient.js';
import type { OAuthSessionStore } from './auth/oauthSessionStore.js';
export interface GatewayApiContext {
users: UserRepository;
sessions: GatewaySessionService;
flushPublisher: GatewayFlushPublisher;
gameTokenSecret: string;
gameSessionTtlSeconds: number;
kakaoClient: KakaoOAuthClient;
oauthSessions: OAuthSessionStore;
publicBaseUrl: string;
}
export const createGatewayApiContext = (options: {
users: UserRepository;
sessions: GatewaySessionService;
flushPublisher: GatewayFlushPublisher;
gameTokenSecret: string;
gameSessionTtlSeconds: number;
kakaoClient: KakaoOAuthClient;
oauthSessions: OAuthSessionStore;
publicBaseUrl: string;
}): GatewayApiContext => ({
users: options.users,
sessions: options.sessions,
flushPublisher: options.flushPublisher,
gameTokenSecret: options.gameTokenSecret,
gameSessionTtlSeconds: options.gameSessionTtlSeconds,
kakaoClient: options.kakaoClient,
oauthSessions: options.oauthSessions,
publicBaseUrl: options.publicBaseUrl,
});