@wristband/nextjs-auth
Version:
SDK for integrating your Next.js application with Wristband. Handles user authentication, session management, and token management.
13 lines (12 loc) • 808 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 NO_CACHE_HEADERS = { 'Cache-Control': 'no-store', Pragma: 'no-cache' };
export const REDIRECT_RESPONSE_INIT = { status: 302, headers: NO_CACHE_HEADERS };
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';