'use server';
import { resolve } from '../../lib/server-container.js';
export async function validateSession(sessionToken) {
    try {
        const useCase = resolve('ValidateSessionUseCase');
        const result = await useCase.execute(sessionToken);
        if (!result.ok)
            return { error: result.error };
        return { user: result.user };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to validate session';
        return { error: message };
    }
}
