AkurAI Build
Menu

Public repository / 7a6a24a4e46f9f1d964c5593c076f9bdf638fea0

AkurAI-Mail / src/lib/webmail/session.ts

Latest change 22202d1bde69be4ace8a299dffd91f8ff24378df - Recover deployed webmail frontend (frontend parity with EC2 a6afffc) by Ólafur Búi Ólafsson

/** Normalizes /api/auth/check into the signed-in webmail session. */

export interface AuthCheck {
  authenticated?: boolean;
  admin?: boolean;
  email?: string;
  user?: string;
  mailbox?: string;
  method?: string;
}

export function webmailSession(check: AuthCheck) {
  return {
    signedIn: !!check.authenticated,
    email: check.email || check.user || check.mailbox || "",
    admin: check.admin ?? check.method === "password",
  };
}