import type { Context } from "hono";
import { signKcgmSsoToken } from "@/lib/session";
import { success, error } from "@/lib/response";

export async function GetKcgmSsoToken(c: Context) {
  const email = c.get("adminEmail") as string | undefined;
  if (!email) return error(c, "Unauthorized Access", 401);
  return success(c, { token: await signKcgmSsoToken(email) });
}
