"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SessionService = void 0;
// backend/src/services/SessionService.ts
const uuid_1 = require("uuid");
const sessions = new Map();
class SessionService {
    static createSession() {
        const id = (0, uuid_1.v4)();
        const newSession = {
            id,
            isAuthenticated: false,
            createdAt: new Date(),
        };
        sessions.set(id, newSession);
        return newSession;
    }
    static getSession(id) {
        return sessions.get(id);
    }
    static authenticateSession(id) {
        const session = sessions.get(id);
        if (session) {
            session.isAuthenticated = true;
            sessions.set(id, session);
            return true;
        }
        return false;
    }
    static destroySession(id) {
        sessions.delete(id);
    }
}
exports.SessionService = SessionService;
