Files
klz-cables.com/.pnpm-store/v10/files/94/56a498af38cc8ffa75cdd818f9a3cdd5ec55710585c45c7760b6693465a4a83f21dcd8538d732a48ebe219bd6b8738ec636891d92ea242d6b9e6fd538d3cc7
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

59 lines
2.2 KiB
Plaintext

//#region src/auth/types.d.ts
type AuthenticationMode = 'json' | 'cookie' | 'session';
type LocalLoginPayload = {
email: string;
password: string;
};
type LDAPLoginPayload = {
identifier: string;
password: string;
};
type LoginPayload = LocalLoginPayload | LDAPLoginPayload;
type LoginOptions = {
/** The user's one-time-password (if MFA is enabled). */
otp?: string;
/** Whether to retrieve the refresh token in the JSON response, or in a httpOnly cookie. One of `json`, `cookie` or `session`. Defaults to `cookie`. */
mode?: AuthenticationMode;
/** Use a specific authentication provider (does not work for SSO that relies on browser redirects). */
provider?: string;
};
type LogoutOptions = {
refresh_token?: string;
mode?: AuthenticationMode;
};
type RefreshOptions = {
refresh_token?: string;
mode?: AuthenticationMode;
};
interface AuthenticationData {
access_token: string | null;
refresh_token: string | null;
expires: number | null;
expires_at: number | null;
}
interface AuthenticationStorage {
get: () => Promise<AuthenticationData | null> | AuthenticationData | null;
set: (value: AuthenticationData | null) => Promise<unknown> | unknown;
}
interface AuthenticationConfig {
autoRefresh: boolean;
msRefreshBeforeExpires: number;
credentials?: RequestCredentials;
storage?: AuthenticationStorage;
}
interface AuthenticationClient<_Schema> {
login(payload: LocalLoginPayload, options?: LoginOptions): Promise<AuthenticationData>;
login(payload: LDAPLoginPayload, options?: LoginOptions): Promise<AuthenticationData>;
refresh(options?: RefreshOptions): Promise<AuthenticationData>;
logout(options?: LogoutOptions): Promise<void>;
stopRefreshing(): void;
getToken(): Promise<string | null>;
setToken(access_token: string | null): Promise<unknown>;
}
interface StaticTokenClient<_Schema> {
getToken(): Promise<string | null>;
setToken(access_token: string | null): Promise<unknown>;
}
//#endregion
export { AuthenticationClient, AuthenticationConfig, AuthenticationData, AuthenticationMode, AuthenticationStorage, LDAPLoginPayload, LocalLoginPayload, LoginOptions, LoginPayload, LogoutOptions, RefreshOptions, StaticTokenClient };
//# sourceMappingURL=types.d.cts.map