UNPKG

@trimble-oss/trimble-id-react

Version:

> **Important Notice:** > > As of version 1.0.0, `PersistentOptions` have been removed. By default, the SDK now supports in-memory token storage. > > When you upgrade to version 1.x, storage options will no longer be available, resulting in a breaking

63 lines (62 loc) 1.89 kB
interface CookiesManagerOptions { /** * Client id of the application created in trimble developer console * @type {string} */ clientId: string; } interface CookieValue { /** * Code verifier used for the PKCE workflow * @see {https://docs.trimblecloud.com/identity_v4.0/how-to/grant-flows/authorization-code-pkce/} Authorization Code with PKCE * @type {string} */ code_verifier: string; /** * State information used for replay attack protection * @type {string} */ state_payload?: string; } /** Class to manage cookies */ export declare class CookiesManager { /** * Cookie full key to store and retrieve the information from cookies * @type {string} */ private readonly cookieKey; /** * Cookie storage. This object contain all functions necessary to retrieve and store tokens using cookies * @type {CookiesStorage} */ private readonly cookiesStorage; /** * Create a cookies manager to extract or save cookies in the browser * @param {CookiesManagerOptions} options - Configuration for the managing the cookies */ constructor(options: CookiesManagerOptions); /** * Store cookies in the browser * @param {Partial<CookieValue>} value - information to store */ save(value: Partial<CookieValue>): void; /** * Retrieve state payload from cookies * @return {string | undefined} - State payload from cookies */ getStatePayload(): string | undefined; /** * Clear state payload from cookies */ clearStatePayload(): void; /** * Retrieve cookies in the browser * @return {CookieValue | undefined} - Cookies from the browser */ get(): CookieValue | undefined; /** * Clear information about the cookies stored in the browser */ clear(): void; } export {};