Menu
Public repository / c3ef99b092caa55fb6a3eed9d3e776734cc99e97
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",
};
}