import { createUnauthenticatedError } from "../auth/types.js";
export async function getWebAuthSession(context, request) {
    return context.auth?.getSession(request.headers);
}
export async function requireWebSession(context, request) {
    const authSession = await getWebAuthSession(context, request);
    if (!authSession)
        throw createUnauthenticatedError();
    return { authSession, ownerScope: `user:${authSession.identity.userId}` };
}
