hanko icon indicating copy to clipboard operation
hanko copied to clipboard

Feat: Expose register configuration options object

Open birdlavv opened this issue 1 year ago • 0 comments

Currently only cookieName?: string parameter be set in the hanko nuxt.config.ts object. Exposing the entire configuration object would allow for far deeper configurability.

const defaultOptions = {
  shadow: true, // Set to false if you do not want the web component to be attached to the shadow DOM.
  injectStyles: true, // Set to false if you do not want to inject any default styles.
  enablePasskeys: true, // Set to false if you do not want to display passkey-related content.
  hidePasskeyButtonOnLogin: false, // Hides the button to sign in with a passkey on the login page.
  translations: null, // Additional translations can be added here. English is used when the option is not
  // present or set to `null`, whereas setting an empty object `{}` prevents the elements
  // from displaying any translations.
  translationsLocation: "/i18n", // The URL or path where the translation files are located.
  fallbackLanguage: "en", // The fallback language to be used if a translation is not available.
  storageKey: "hanko", // The name of the cookie the session token is stored in and the prefix / name of local storage keys
  cookieDomain: undefined, // The domain where the cookie set from the SDK is available. When undefined,
  // defaults to the domain of the page where the cookie was created.
  cookieSameSite: "lax", // Specify whether/when cookies are sent with cross-site requests.
};

Use case: There currently is no way to set cookieDomain parameter using the current interface.

birdlavv avatar Jun 06 '24 18:06 birdlavv