@wristband/express-auth
Version:
SDK for integrating your ExpressJS application with Wristband. Handles user authentication, session management, and token management.
13 lines (12 loc) • 729 B
JavaScript
export const FORM_URLENCODED_MEDIA_TYPE = 'application/x-www-form-urlencoded';
export const JSON_MEDIA_TYPE = 'application/json;charset=UTF-8';
export const LOGIN_REQUIRED_ERROR = 'login_required';
export const LOGIN_STATE_COOKIE_SEPARATOR = '#';
export const LOGIN_STATE_COOKIE_PREFIX = `login${LOGIN_STATE_COOKIE_SEPARATOR}`;
export const MAX_REFRESH_ATTEMPTS = 3;
export const MAX_REFRESH_ATTEMPT_DELAY_MS = 100;
export const TENANT_DOMAIN_PLACEHOLDER = '{tenant_domain}';
export const TENANT_NAME_PLACEHOLDER = '{tenant_name}';
// Regex to match either placeholder
export const TENANT_PLACEHOLDER_REGEX = /\{tenant_(?:domain|name)\}/;
export const TENANT_PLACEHOLDER_MSG = '"{tenant_name}" or "{tenant_domain}" placeholder';