@liquid-js/lyr-auth 0.0.0-stage → 22.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE.txt +23 -0
  2. package/README.md +61 -2
  3. package/components/auth-block/_auth-block.component.theme.scss +17 -0
  4. package/components/auth-block/auth-block.component.scss +98 -0
  5. package/components/auth.component.html +22 -0
  6. package/components/auth.component.scss +54 -0
  7. package/components/login/login.component.html +154 -0
  8. package/components/logout/logout.component.html +1 -0
  9. package/components/register/register.component.html +212 -0
  10. package/components/register/register.component.scss +5 -0
  11. package/components/request-password/request-password.component.html +81 -0
  12. package/components/reset-password/reset-password.component.html +116 -0
  13. package/components/reset-password/reset-password.component.scss +5 -0
  14. package/fesm2022/liquid-js-lyr-auth.mjs +2900 -0
  15. package/fesm2022/liquid-js-lyr-auth.mjs.map +1 -0
  16. package/package.json +59 -3
  17. package/styles/_globals.scss +5 -0
  18. package/styles/global/_components.scss +6 -0
  19. package/styles/prebuilt/components-custom-properties.css +1 -0
  20. package/styles/prebuilt/components-custom-properties.scss +10 -0
  21. package/styles/prebuilt/corporate-custom-properties.css +1 -0
  22. package/styles/prebuilt/corporate-custom-properties.scss +2 -0
  23. package/styles/prebuilt/corporate.css +1 -0
  24. package/styles/prebuilt/corporate.scss +12 -0
  25. package/styles/prebuilt/cosmic-custom-properties.css +1 -0
  26. package/styles/prebuilt/cosmic-custom-properties.scss +2 -0
  27. package/styles/prebuilt/cosmic.css +1 -0
  28. package/styles/prebuilt/cosmic.scss +12 -0
  29. package/styles/prebuilt/dark-custom-properties.css +1 -0
  30. package/styles/prebuilt/dark-custom-properties.scss +2 -0
  31. package/styles/prebuilt/dark.css +1 -0
  32. package/styles/prebuilt/dark.scss +12 -0
  33. package/styles/prebuilt/default-custom-properties.css +1 -0
  34. package/styles/prebuilt/default-custom-properties.scss +2 -0
  35. package/styles/prebuilt/default.css +1 -0
  36. package/styles/prebuilt/default.scss +12 -0
  37. package/types/liquid-js-lyr-auth.d.ts +1236 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquid-js-lyr-auth.mjs","names":["observableOf","observableOf","observableOf","observableOf","observableOf"],"sources":["../../../packages/auth/src/auth.options.ts","../../../packages/auth/src/helpers.ts","../../../packages/auth/src/services/token/token.ts","../../../packages/auth/src/services/token/token-parceler.ts","../../../packages/auth/src/services/token/token-storage.ts","../../../packages/auth/src/services/token/token.service.ts","../../../packages/auth/src/services/auth.service.ts","../../../packages/auth/src/texts.ts","../../../packages/auth/src/strategies/auth-strategy.ts","../../../packages/auth/src/services/auth-result.ts","../../../packages/auth/src/strategies/auth-strategy-options.ts","../../../packages/auth/src/strategies/dummy/dummy-strategy-options.ts","../../../packages/auth/src/strategies/dummy/dummy-strategy.ts","../../../packages/auth/src/strategies/oauth2/oauth2-strategy.options.ts","../../../packages/auth/src/strategies/oauth2/oauth2-strategy.ts","../../../packages/auth/src/strategies/password/password-strategy-options.ts","../../../packages/auth/src/strategies/password/password-strategy.ts","../../../packages/auth/src/components/auth-block/auth-block.component.ts","../../../packages/auth/src/components/auth.component.ts","../../../packages/auth/src/components/auth.component.html","../../../packages/auth/src/components/login/login.component.ts","../../../packages/auth/src/components/login/login.component.html","../../../packages/auth/src/components/register/register.component.ts","../../../packages/auth/src/components/register/register.component.html","../../../packages/auth/src/components/logout/logout.component.ts","../../../packages/auth/src/components/logout/logout.component.html","../../../packages/auth/src/components/request-password/request-password.component.ts","../../../packages/auth/src/components/request-password/request-password.component.html","../../../packages/auth/src/components/reset-password/reset-password.component.ts","../../../packages/auth/src/components/reset-password/reset-password.component.html","../../../packages/auth/src/auth.module.ts","../../../packages/auth/src/auth.routes.ts","../../../packages/auth/src/services/interceptors/jwt-interceptor.ts","../../../packages/auth/src/services/interceptors/simple-interceptor.ts","../../../packages/auth/src/models/user.ts"],"sourcesContent":["import { InjectionToken, Type } from '@angular/core'\nimport { HttpRequest } from '@angular/common/http'\nimport { NbAuthStrategy } from './strategies/auth-strategy'\nimport { NbAuthStrategyOptions } from './strategies/auth-strategy-options'\nimport { NbAuthToken, NbAuthTokenClass } from './services/token/token'\nimport { NbAuthDeepPartial } from './helpers'\n\nexport type NbAuthStrategyClass = Type<NbAuthStrategy>\n\nexport type NbAuthStrategies = Array<[NbAuthStrategyClass, NbAuthStrategyOptions]>\n\nexport interface NbAuthSocialLink {\n link?: string\n url?: string\n target?: string\n /** The link's text, or its accessible name when it shows an icon. */\n title?: string\n /** An icon shown in place of the title. */\n icon?: string\n}\n\n/** Whether a form shows the messages of a successful action, and the errors of a failed one. */\nexport interface NbAuthFormMessagesOptions {\n success: boolean\n error: boolean\n}\n\n/** The options of an auth form. */\nexport interface NbAuthFormOptions {\n /** The delay before the redirect after a successful action, while its message is shown, in milliseconds. */\n redirectDelay: number\n /** The name of the strategy the form uses. */\n strategy: string\n showMessages: NbAuthFormMessagesOptions\n /** The social links at the bottom of the form. */\n socialLinks: NbAuthSocialLink[]\n}\n\nexport interface NbAuthLoginFormOptions extends NbAuthFormOptions {\n /** Whether to show the \"remember me\" checkbox. */\n rememberMe: boolean\n}\n\nexport interface NbAuthRegisterFormOptions extends NbAuthFormOptions {\n /** Whether the user has to agree to the terms. */\n terms: boolean\n}\n\nexport interface NbAuthLogoutFormOptions {\n redirectDelay: number\n strategy: string\n}\n\n/** The limits of a field of the auth forms. */\nexport interface NbAuthFieldValidation {\n required: boolean\n}\n\n/** The limits of a field of the auth forms with a length. */\nexport interface NbAuthLengthValidation extends NbAuthFieldValidation {\n minLength: number\n maxLength: number\n}\n\nexport interface NbAuthValidationOptions {\n password: NbAuthLengthValidation\n email: NbAuthFieldValidation\n fullName: NbAuthLengthValidation\n}\n\n/** The options of the auth forms, as the defaults give them. */\nexport interface NbAuthForms {\n login: NbAuthLoginFormOptions\n register: NbAuthRegisterFormOptions\n requestPassword: NbAuthFormOptions\n resetPassword: NbAuthFormOptions\n logout: NbAuthLogoutFormOptions\n validation: NbAuthValidationOptions\n}\n\nexport interface NbAuthOptions {\n /** The options of the forms, over the defaults. */\n forms?: NbAuthDeepPartial<NbAuthForms>\n strategies?: NbAuthStrategies\n}\n\n/** The options the auth module works with: the given ones over `defaultAuthOptions`. */\nexport interface NbAuthResolvedOptions {\n forms: NbAuthForms\n strategies: NbAuthStrategies\n}\n\nconst socialLinks = new Array<NbAuthSocialLink>()\n\nexport const defaultAuthOptions: NbAuthResolvedOptions = {\n strategies: [],\n forms: {\n login: {\n redirectDelay: 500,\n strategy: 'email', // the name of the strategy in `strategies`\n rememberMe: true,\n showMessages: {\n success: true,\n error: true\n },\n socialLinks\n },\n register: {\n redirectDelay: 500,\n strategy: 'email',\n showMessages: {\n success: true,\n error: true\n },\n terms: true,\n socialLinks\n },\n requestPassword: {\n redirectDelay: 500,\n strategy: 'email',\n showMessages: {\n success: true,\n error: true\n },\n socialLinks\n },\n resetPassword: {\n redirectDelay: 500,\n strategy: 'email',\n showMessages: {\n success: true,\n error: true\n },\n socialLinks\n },\n logout: {\n redirectDelay: 500,\n strategy: 'email'\n },\n validation: {\n password: {\n required: true,\n minLength: 4,\n maxLength: 50\n },\n email: {\n required: true\n },\n fullName: {\n required: false,\n minLength: 4,\n maxLength: 50\n }\n }\n }\n}\n\nexport const NB_AUTH_OPTIONS = new InjectionToken<NbAuthResolvedOptions>('Lyra Auth Options')\nexport const NB_AUTH_USER_OPTIONS = new InjectionToken<NbAuthOptions>('Lyra User Auth Options')\nexport const NB_AUTH_STRATEGIES = new InjectionToken<NbAuthStrategy[]>('Lyra Auth Strategies')\nexport const NB_AUTH_TOKENS = new InjectionToken<Array<NbAuthTokenClass<NbAuthToken>>>('Lyra Auth Tokens')\nexport const NB_AUTH_INTERCEPTOR_HEADER = new InjectionToken<string>('Lyra Simple Interceptor Header')\nexport const NB_AUTH_TOKEN_INTERCEPTOR_FILTER =\n new InjectionToken<(req: HttpRequest<unknown>) => boolean>('Lyra Interceptor Filter')\n","/** Whether the value is an object (or a function) whose properties can be read and set. */\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return (typeof value === 'object' && value !== null) || typeof value === 'function'\n}\n\n/**\n * Merges the sources into the target, deep for plain objects: arrays, dates and regexps are cloned, and instances of\n * other classes (e.g. `HttpHeaders`) are kept whole. Returns the target, or `false` when it isn't an object. To merge\n * without changing any source, give a new object as the target: `deepExtend({}, defaults, options)`.\n *\n * Typed as the target and the sources together, which holds while the sources have (parts of) the target's shape.\n */\nexport function deepExtend<T extends object>(target: T): T\nexport function deepExtend<T extends object, A>(target: T, a: A): T & A\nexport function deepExtend<T extends object, A, B>(target: T, a: A, b: B): T & A & B\nexport function deepExtend<T extends object, A, B, C>(target: T, a: A, b: B, c: C): T & A & B & C\nexport function deepExtend(target: object, ...sources: unknown[]): object\nexport function deepExtend(...objects: unknown[]): unknown {\n const target = objects[0]\n if (objects.length < 1 || typeof target !== 'object' || !isRecord(target)) {\n return false\n }\n\n if (objects.length < 2) {\n return target\n }\n\n // cut off target object\n const args = objects.slice(1)\n\n args.forEach((obj) => {\n // skip argument if it is array or isn't object\n if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {\n return\n }\n\n Object.entries(obj).forEach(([key, val]: [string, unknown]) => {\n const src = target[key] // source value\n\n // recursion prevention\n if (val === target) {\n return\n\n // a primitive replaces the value\n } else if (typeof val !== 'object' || val === null) {\n target[key] = val\n\n return\n\n // just clone arrays (and recursive clone objects inside)\n } else if (Array.isArray(val)) {\n target[key] = deepCloneArray(val)\n\n return\n\n // custom cloning and overwrite for specific objects\n } else if (isSpecificValue(val)) {\n target[key] = cloneSpecificValue(val)\n\n return\n\n // instances of other classes (e.g. HttpHeaders) are kept whole, so they stay what they are\n } else if (!isPlainObject(val)) {\n target[key] = val\n\n return\n\n // overwrite by new value if source isn't object or array\n } else if (typeof src !== 'object' || src === null || Array.isArray(src)) {\n target[key] = deepExtend({}, val)\n\n return\n\n // source value and new value is objects both, extending...\n } else {\n target[key] = deepExtend(src, val)\n\n return\n }\n })\n })\n\n return target\n}\n\n/** Whether the value is an object literal (or has no prototype), rather than an instance of some class. */\nfunction isPlainObject(val: object): boolean {\n const prototype: unknown = Object.getPrototypeOf(val)\n return prototype === Object.prototype || prototype === null\n}\n\nfunction isSpecificValue(val: unknown): val is Date | RegExp {\n return val instanceof Date || val instanceof RegExp\n}\n\nfunction cloneSpecificValue(val: Date | RegExp): Date | RegExp {\n if (val instanceof Date) {\n return new Date(val.getTime())\n } else {\n return new RegExp(val)\n }\n}\n\n/** Clones an array, and the arrays and plain objects in it, as `deepExtend` does. */\nfunction deepCloneArray(arr: ReadonlyArray<unknown>): unknown[] {\n const clone = new Array<unknown>()\n arr.forEach((item, index) => {\n if (typeof item === 'object' && item !== null) {\n if (Array.isArray(item)) {\n clone[index] = deepCloneArray(item)\n } else if (isSpecificValue(item)) {\n clone[index] = cloneSpecificValue(item)\n } else if (!isPlainObject(item)) {\n clone[index] = item\n } else {\n clone[index] = deepExtend({}, item)\n }\n } else {\n clone[index] = item\n }\n })\n\n return clone\n}\n\n/** Values a dotted path doesn't go into: arrays, functions and classes. */\ntype NbPathLeaf = ReadonlyArray<unknown> | ((...args: never) => unknown) | (abstract new (...args: never) => unknown)\n\n/**\n * T with every property optional, all the way down; arrays, functions and classes are given whole.\n */\nexport type NbAuthDeepPartial<T> = { [K in keyof T]?: NbAuthDeepPartialValue<T[K]> }\n\n/** A value of `NbAuthDeepPartial`, each type of a union on its own. */\ntype NbAuthDeepPartialValue<V> = V extends NbPathLeaf ? V : V extends object ? NbAuthDeepPartial<V> : V\n\n/**\n * The dotted paths `getDeepFromObject` can follow into T, such as `'login'` and `'login.redirect.success'`. Arrays,\n * functions and classes end a path; optional and union properties are followed into their object types.\n */\nexport type NbPath<T> = T extends NbPathLeaf\n ? never\n : T extends object\n ? { [K in keyof T & string]-?: K | `${K}.${NbPath<T[K]>}` }[keyof T & string]\n : never\n\n/**\n * The value at the dotted path P into T, as `getDeepFromObject` reads it: `undefined` where a step on the way may be\n * missing or isn't an object.\n */\nexport type NbPathValue<T, P extends string> = T extends NbPathLeaf\n ? undefined\n : T extends object\n ? P extends `${infer K}.${infer Rest}`\n ? K extends keyof T\n ? NbPathValue<T[K], Rest>\n : undefined\n : P extends keyof T\n ? T[P]\n : undefined\n : undefined\n\n/**\n * Reads the value at a dotted path, from a copy of the object, or the default where there's none.\n *\n * getDeepFromObject({result: {data: 1}}, 'result.data', 2); // returns 1\n */\nexport function getDeepFromObject<T, P extends NbPath<T>>(object: T, name: P): NbPathValue<T, P>\nexport function getDeepFromObject(object: unknown, name: string, defaultValue?: unknown): unknown\nexport function getDeepFromObject(object: unknown = {}, name: string, defaultValue?: unknown): unknown {\n const keys = name.split('.')\n // clone the object\n let level: unknown = deepExtend({}, object || {})\n keys.forEach((k) => {\n level = isRecord(level) ? level[k] : undefined\n })\n\n return typeof level === 'undefined' ? defaultValue : level\n}\n\n/** The messages (or errors) in a value read from a response: a message, or a list of them; anything else isn't one. */\nexport function nbAuthMessages(value: unknown): string[] {\n const messages: unknown[] = Array.isArray(value) ? value : [value]\n return messages.filter((message) => typeof message === 'string')\n}\n\nexport function urlBase64Decode(str: string): string {\n let output = str.replace(/-/g, '+').replace(/_/g, '/')\n switch (output.length % 4) {\n case 0: { break }\n case 2: { output += '=='; break }\n case 3: { output += '='; break }\n default: {\n throw new Error('Illegal base64url string!')\n }\n }\n return b64DecodeUnicode(output)\n}\n\nexport function b64decode(str: string): string {\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n let output = ''\n\n str = String(str).replace(/=+$/, '')\n\n if (str.length % 4 === 1) {\n throw new Error('\\'atob\\' failed: The string to be decoded is not correctly encoded.')\n }\n\n // bc counts the characters, bs stores their bits\n let bc = 0\n let bs = 0\n for (const char of str) {\n // try to find character in table (0-63, not found => -1)\n const value = chars.indexOf(char)\n if (value === -1) {\n continue\n }\n // add the character's bits to the storage,\n bs = bc % 4 ? bs * 64 + value : value\n // and if not first of each 4 characters, convert the first 8 bits to one ascii character\n if (bc++ % 4) {\n output += String.fromCharCode(255 & (bs >> ((-2 * bc) & 6)))\n }\n }\n return output\n}\n\n// https://developer.mozilla.org/en/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem\nexport function b64DecodeUnicode(str: string) {\n return decodeURIComponent(Array.from(b64decode(str), (c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)).join(''))\n}\n","import { urlBase64Decode } from '../../helpers'\n\nexport abstract class NbAuthToken {\n\n protected payload?: unknown\n\n abstract getValue(): string\n abstract isValid(): boolean\n /** The name of the strategy that got the token, which is the one that refreshes it. */\n abstract getOwnerStrategyName(): string\n abstract getCreatedAt(): Date\n abstract toString(): string\n\n getName(): string {\n return (this.constructor as NbAuthTokenClass).NAME\n }\n\n getPayload(): unknown {\n return this.payload\n }\n}\n\n/**\n * The claims of a JWT: the registered ones (RFC 7519, 4.1) and any others the issuer adds.\n */\nexport interface NbAuthJWTPayload {\n /** Expiration time, in seconds since the epoch. */\n exp?: number\n /** Issued at, in seconds since the epoch. */\n iat?: number\n /** Not before, in seconds since the epoch. */\n nbf?: number\n sub?: string\n iss?: string\n aud?: string | string[]\n jti?: string\n [claim: string]: unknown\n}\n\n/**\n * An OAuth2 token response (RFC 6749, 5.1), and any other fields the server adds.\n */\nexport interface NbAuthOAuth2TokenData {\n access_token?: string\n token_type?: string\n /** The lifetime of the access token, in seconds. */\n expires_in?: number | string\n refresh_token?: string\n scope?: string\n [field: string]: unknown\n}\n\nexport class NbAuthTokenNotFoundError extends Error {\n constructor(message: string) {\n super(message)\n Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n\nexport class NbAuthIllegalTokenError extends Error {\n constructor(message: string) {\n super(message)\n Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n\nexport class NbAuthEmptyTokenError extends NbAuthIllegalTokenError {\n constructor(message: string) {\n super(message)\n Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n\nexport class NbAuthIllegalJWTTokenError extends NbAuthIllegalTokenError {\n constructor(message: string) {\n super(message)\n Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n\nexport interface NbAuthRefreshableToken {\n getRefreshToken(): string\n setRefreshToken(refreshToken: string): void\n}\n\nexport interface NbAuthTokenClass<T = NbAuthToken> {\n NAME: string\n new (raw: unknown, strategyName: string, expDate?: Date): T\n}\n\nexport function nbAuthCreateToken<T extends NbAuthToken>(tokenClass: NbAuthTokenClass<T>,\n token: unknown,\n ownerStrategyName: string,\n createdAt?: Date) {\n return new tokenClass(token, ownerStrategyName, createdAt)\n}\n\nexport function decodeJwtPayload(payload: string): NbAuthJWTPayload {\n\n if (payload.length === 0) {\n throw new NbAuthEmptyTokenError('Cannot extract from an empty payload.')\n }\n\n const parts = payload.split('.')\n\n if (parts.length !== 3) {\n throw new NbAuthIllegalJWTTokenError(\n `The payload ${payload} is not valid JWT payload and must consist of three parts.`)\n }\n\n let decoded\n try {\n decoded = urlBase64Decode(parts[1])\n } catch {\n throw new NbAuthIllegalJWTTokenError(\n `The payload ${payload} is not valid JWT payload and cannot be parsed.`)\n }\n\n if (!decoded) {\n throw new NbAuthIllegalJWTTokenError(\n `The payload ${payload} is not valid JWT payload and cannot be decoded.`)\n }\n return JSON.parse(decoded) as NbAuthJWTPayload\n}\n\n/** A token that is a plain string; valid while it isn't empty. */\nexport class NbAuthSimpleToken extends NbAuthToken {\n\n static NAME = 'nb:auth:simple:token'\n\n protected createdAt: Date\n\n constructor(protected readonly token: unknown,\n protected readonly ownerStrategyName: string,\n createdAt?: Date) {\n super()\n // Set before parsing, as the constructor parameter property did, so subclasses can read it in parsePayload().\n if (createdAt) {\n this.createdAt = createdAt\n }\n try {\n this.parsePayload()\n } catch (err) {\n if (!(err instanceof NbAuthTokenNotFoundError)) {\n // token is present but has got a problem, including illegal\n throw err\n }\n }\n this.createdAt = this.prepareCreatedAt(createdAt)\n }\n\n protected parsePayload(): void {\n this.payload = undefined\n }\n\n protected prepareCreatedAt(date?: Date): Date {\n return date ? date : new Date()\n }\n\n /** When the token was made, or when the storage says it was. */\n getCreatedAt(): Date {\n return this.createdAt\n }\n\n /** The token's text; empty when it isn't a string. */\n getValue(): string {\n return typeof this.token === 'string' ? this.token : ''\n }\n\n getOwnerStrategyName(): string {\n return this.ownerStrategyName\n }\n\n /** Whether the token isn't empty. */\n isValid(): boolean {\n return !!this.getValue()\n }\n\n /** The token as text, for the storage; empty without one. */\n toString(): string {\n return this.token ? String(this.token) : ''\n }\n}\n\n/** A JWT: its payload is decoded, it's created at its `iat` claim, and it's valid until its `exp` claim. */\nexport class NbAuthJWTToken extends NbAuthSimpleToken {\n\n static override NAME = 'nb:auth:jwt:token'\n\n protected declare payload?: NbAuthJWTPayload\n\n /** The `iat` claim, when there is one. */\n protected override prepareCreatedAt(date?: Date): Date {\n const decoded = this.getPayload()\n return decoded && decoded.iat ? new Date(Number(decoded.iat) * 1000) : super.prepareCreatedAt(date)\n }\n\n /**\n * Decodes the payload; throws `NbAuthTokenNotFoundError` without a token, and `NbAuthIllegalJWTTokenError` for one\n * that isn't a JWT.\n */\n protected override parsePayload() {\n if (!this.token) {\n throw new NbAuthTokenNotFoundError('Token not found. ')\n }\n if (typeof this.token !== 'string') {\n throw new NbAuthIllegalJWTTokenError('The JWT token is not a string.')\n }\n this.payload = decodeJwtPayload(this.token)\n }\n\n /** The token's claims, or `undefined` without a token. */\n override getPayload(): NbAuthJWTPayload | undefined {\n return this.payload\n }\n\n /** The `exp` claim as a date, or `undefined` without one. */\n getTokenExpDate(): Date | undefined {\n const decoded = this.getPayload()\n if (decoded && !decoded.hasOwnProperty('exp')) {\n return undefined\n }\n const date = new Date(0)\n date.setUTCSeconds(Number(decoded?.exp)) // JWT times are in seconds\n return date\n }\n\n /** Whether the token isn't empty and hasn't expired. */\n override isValid(): boolean {\n if (!super.isValid()) {\n return false\n }\n const expDate = this.getTokenExpDate()\n return !expDate || new Date() < expDate\n }\n}\n\nconst prepareOAuth2Token = (data: unknown): unknown => {\n if (typeof data === 'string') {\n try {\n return JSON.parse(data)\n } catch {}\n }\n return data\n}\n\n/** Whether the raw token is an object, which an OAuth2 token reads as a token response. */\nfunction isOAuth2TokenData(token: unknown): token is NbAuthOAuth2TokenData {\n return typeof token === 'object' && token !== null\n}\n\n/**\n * An OAuth2 token response: its `access_token` is the value, and it expires `expires_in` seconds after it was created.\n */\nexport class NbAuthOAuth2Token extends NbAuthSimpleToken {\n\n static override NAME = 'nb:auth:oauth2:token'\n\n /**\n * @param data the token response, or its JSON (as the storage gives it)\n */\n constructor(data: unknown = {},\n ownerStrategyName: string,\n createdAt?: Date) {\n\n // we may get it as string when retrieving from a storage\n super(prepareOAuth2Token(data), ownerStrategyName, createdAt)\n }\n\n /** The token response; empty when the raw token isn't one. */\n protected get data(): NbAuthOAuth2TokenData {\n return isOAuth2TokenData(this.token) ? this.token : {}\n }\n\n /** The `access_token`; empty without one. */\n override getValue(): string {\n return this.data.access_token ?? ''\n }\n\n /** The `refresh_token`; empty without one. */\n getRefreshToken(): string {\n return this.data.refresh_token ?? ''\n }\n\n /** Sets the `refresh_token`, e.g. the previous token's after a refresh whose response has none. */\n setRefreshToken(refreshToken: string) {\n this.data.refresh_token = refreshToken\n }\n\n /** The payload is the response itself; throws without a token, or with an empty one. */\n protected override parsePayload() {\n if (!this.token) {\n throw new NbAuthTokenNotFoundError('Token not found.')\n } else {\n if (!Object.keys(this.token).length) {\n throw new NbAuthEmptyTokenError('Cannot extract payload from an empty token.')\n }\n }\n this.payload = this.token\n }\n\n /** The `token_type`, e.g. `Bearer`; empty without one. */\n getType(): string {\n return this.data.token_type ?? ''\n }\n\n /** Whether the token has an `access_token` and hasn't expired. */\n override isValid(): boolean {\n if (!super.isValid()) {\n return false\n }\n const expDate = this.getTokenExpDate()\n return !expDate || new Date() < expDate\n }\n\n /** When the token expires, `expires_in` seconds after it was created; `undefined` without `expires_in`. */\n getTokenExpDate(): Date | undefined {\n const data = this.data\n if (!data.hasOwnProperty('expires_in')) {\n return undefined\n }\n return new Date(this.createdAt.getTime() + Number(data.expires_in) * 1000)\n }\n\n /** The response as JSON, for the storage. */\n override toString(): string {\n return JSON.stringify(this.token)\n }\n}\n\n/**\n * An OAuth2 token whose `access_token` is a JWT: its claims say when the token was created and expires, over the\n * response's `expires_in`.\n */\nexport class NbAuthOAuth2JWTToken extends NbAuthOAuth2Token {\n\n static override NAME = 'nb:auth:oauth2:jwt:token'\n\n protected accessTokenPayload?: NbAuthJWTPayload\n\n protected override parsePayload() {\n super.parsePayload()\n this.parseAccessTokenPayload()\n }\n\n protected parseAccessTokenPayload(): void {\n const accessToken = this.getValue()\n if (!accessToken) {\n throw new NbAuthTokenNotFoundError('access_token key not found.')\n }\n this.accessTokenPayload = decodeJwtPayload(accessToken)\n }\n\n /** The access token's claims; `undefined` when it has none. */\n getAccessTokenPayload(): NbAuthJWTPayload | undefined {\n return this.accessTokenPayload\n }\n\n /** The access token's `iat` claim, when there is one. */\n protected override prepareCreatedAt(date?: Date): Date {\n const payload = this.accessTokenPayload\n return payload && payload.iat ? new Date(Number(payload.iat) * 1000) : super.prepareCreatedAt(date)\n }\n\n /** Whether the access token has claims, and the token is valid. */\n override isValid(): boolean {\n return !!this.accessTokenPayload && super.isValid()\n }\n\n /** The access token's `exp` claim as a date, or the response's `expires_in` without one. */\n override getTokenExpDate(): Date | undefined {\n if (this.accessTokenPayload && this.accessTokenPayload.hasOwnProperty('exp')) {\n const date = new Date(0)\n date.setUTCSeconds(Number(this.accessTokenPayload.exp))\n return date\n } else {\n return super.getTokenExpDate()\n }\n }\n}\n","import { InjectionToken, inject, Service } from '@angular/core'\n\nimport { NB_AUTH_TOKENS } from '../../auth.options'\nimport { nbAuthCreateToken, NbAuthToken, NbAuthTokenClass } from './token'\n\nexport interface NbTokenPack {\n name: string\n ownerStrategyName: string\n createdAt: number\n value: string\n}\n\n/**\n * The class a stored token is restored as when its own isn't among `NB_AUTH_TOKENS`, and of the empty token when\n * there's none stored; `NbAuthSimpleToken` as `provideNbAuth` sets it.\n */\nexport const NB_AUTH_FALLBACK_TOKEN = new InjectionToken<NbAuthTokenClass>('Lyra Auth Options')\n\n/** Writes a token as JSON for the storage, with its class, strategy and creation time, and reads it back. */\n@Service({ autoProvided: false })\nexport class NbAuthTokenParceler {\n private readonly fallbackClass = inject<NbAuthTokenClass>(NB_AUTH_FALLBACK_TOKEN)\n private readonly tokenClasses = inject(NB_AUTH_TOKENS)\n\n wrap(token: NbAuthToken): string {\n return JSON.stringify({\n name: token.getName(),\n ownerStrategyName: token.getOwnerStrategyName(),\n createdAt: token.getCreatedAt().getTime(),\n value: token.toString()\n })\n }\n\n /** Restores a token from its parcel; the fallback class's empty token without one, or from one it can't read. */\n unwrap(value?: string): NbAuthToken {\n let tokenClass: NbAuthTokenClass = this.fallbackClass\n let tokenValue = ''\n let tokenOwnerStrategyName = ''\n let tokenCreatedAt: Date | undefined\n\n const tokenPack = this.parseTokenPack(value)\n if (tokenPack) {\n tokenClass = this.getClassByName(tokenPack.name) || this.fallbackClass\n tokenValue = tokenPack.value\n tokenOwnerStrategyName = tokenPack.ownerStrategyName\n tokenCreatedAt = new Date(Number(tokenPack.createdAt))\n }\n\n return nbAuthCreateToken(tokenClass, tokenValue, tokenOwnerStrategyName, tokenCreatedAt)\n\n }\n\n protected getClassByName(name: string): NbAuthTokenClass | undefined {\n return this.tokenClasses.find((tokenClass: NbAuthTokenClass) => tokenClass.NAME === name)\n }\n\n protected parseTokenPack(value?: string): NbTokenPack | undefined {\n if (value === undefined) {\n return undefined\n }\n try {\n // JSON gives null for a stored `null`\n return JSON.parse(value) ?? undefined\n } catch { }\n return undefined\n }\n}\n","import { DestroyRef, PLATFORM_ID, inject, Service } from '@angular/core'\nimport { Observable, Subject } from 'rxjs'\nimport { isPlatformBrowser } from '@angular/common'\n\nimport { NbAuthToken } from './token'\nimport { NbAuthTokenParceler } from './token-parceler'\n\n/** Where a token is kept. */\nexport interface NbTokenStorageOptions {\n /**\n * Whether the token outlives the browser session, e.g. the login form's \"remember me\". Without it, a token stays\n * where the current one is, or is remembered.\n */\n remember?: boolean\n}\n\nexport abstract class NbTokenStorage {\n\n abstract get(): NbAuthToken\n abstract set(token: NbAuthToken, options?: NbTokenStorageOptions): void\n abstract clear(): void\n\n /** Tells when the token changes from elsewhere, e.g. another tab, so the token service reads it again. */\n readonly changes?: Observable<void>\n}\n\n/** What tabs tell each other about a token kept for the session only. */\ntype NbTokenMessage =\n | { type: 'request' }\n | { type: 'session', raw: string }\n | { type: 'remembered' }\n | { type: 'clear' }\n\n/**\n * Keeps the token in `localStorage` when it's remembered, and in `sessionStorage` when it isn't, so it's gone when the\n * browser closes. Tabs share a session token over a `BroadcastChannel`: a new tab asks the open ones for it, and a\n * new, refreshed or cleared token reaches them all.\n */\n@Service({ autoProvided: false })\nexport class NbTokenLocalStorage extends NbTokenStorage {\n private readonly parceler = inject(NbAuthTokenParceler)\n\n protected key = 'auth_app_token'\n\n /** `localStorage`; not set during server-side rendering, where the token is simply absent. */\n protected storage?: Storage\n /** `sessionStorage`, for a token that isn't remembered. */\n protected session?: Storage\n protected channel?: BroadcastChannel\n protected readonly changed = new Subject<void>()\n override readonly changes = this.changed.asObservable()\n\n constructor() {\n const platformId = inject(PLATFORM_ID, { optional: true })\n\n super()\n const isBrowser = !platformId || isPlatformBrowser(platformId)\n this.storage = isBrowser && typeof localStorage !== 'undefined' ? localStorage : undefined\n this.session = isBrowser && typeof sessionStorage !== 'undefined' ? sessionStorage : undefined\n\n if (isBrowser && typeof BroadcastChannel !== 'undefined') {\n const channel = new BroadcastChannel(`nb-auth-${this.key}`)\n this.channel = channel\n channel.onmessage = (event: MessageEvent<NbTokenMessage>) => this.receive(event.data)\n inject(DestroyRef, { optional: true })?.onDestroy(() => channel.close())\n // A new tab without a token asks the open ones for theirs.\n if (!this.read()) {\n this.post({ type: 'request' })\n }\n }\n }\n\n /** The stored token, the session's over the remembered one; an empty token of the fallback class without one. */\n get(): NbAuthToken {\n return this.parceler.unwrap(this.read())\n }\n\n /**\n * Keeps the token: in `localStorage` when it's remembered, in `sessionStorage`, shared with the other tabs, when it\n * isn't.\n */\n set(token: NbAuthToken, options?: NbTokenStorageOptions) {\n const raw = this.parceler.wrap(token)\n const remember = options?.remember ?? !this.session?.getItem(this.key)\n if (remember) {\n this.session?.removeItem(this.key)\n this.storage?.setItem(this.key, raw)\n this.post({ type: 'remembered' })\n } else {\n this.storage?.removeItem(this.key)\n this.session?.setItem(this.key, raw)\n this.post({ type: 'session', raw })\n }\n }\n\n /** Removes the token from both storages, and from the other tabs. */\n clear() {\n this.storage?.removeItem(this.key)\n this.session?.removeItem(this.key)\n this.post({ type: 'clear' })\n }\n\n protected read(): string | undefined {\n return this.session?.getItem(this.key) ?? this.storage?.getItem(this.key) ?? undefined\n }\n\n protected post(message: NbTokenMessage) {\n this.channel?.postMessage(message)\n }\n\n protected receive(message: NbTokenMessage) {\n switch (message.type) {\n case 'request': {\n const raw = this.session?.getItem(this.key)\n if (raw) {\n this.post({ type: 'session', raw })\n }\n return\n }\n case 'session':\n this.session?.setItem(this.key, message.raw)\n break\n case 'remembered':\n case 'clear':\n this.session?.removeItem(this.key)\n break\n }\n this.changed.next()\n }\n}\n","import { inject, Service } from '@angular/core'\nimport { Observable, BehaviorSubject, of as observableOf } from 'rxjs'\nimport { filter, share } from 'rxjs/operators'\n\nimport { NbTokenStorage, NbTokenStorageOptions } from './token-storage'\nimport { NbAuthToken } from './token'\n\n/** Gets, sets and clears the token in the `NbTokenStorage`, and tells when it changes, also from another tab. */\n@Service({ autoProvided: false })\nexport class NbTokenService {\n protected readonly tokenStorage = inject(NbTokenStorage)\n\n protected token$ = new BehaviorSubject<NbAuthToken | undefined>(undefined)\n\n constructor() {\n this.publishStoredToken()\n // E.g. another tab signed in or out.\n this.tokenStorage.changes?.subscribe(() => this.publishStoredToken())\n }\n\n /** The token, now and whenever it's set or cleared. */\n tokenChange(): Observable<NbAuthToken> {\n return this.token$\n .pipe(\n filter((value): value is NbAuthToken => !!value),\n share()\n )\n }\n\n /** Stores the token, as `NbAuthService` does with the one a strategy gets. */\n set(token: NbAuthToken, options?: NbTokenStorageOptions): Observable<void> {\n this.tokenStorage.set(token, options)\n this.publishStoredToken()\n return observableOf(undefined)\n }\n\n /** The stored token. */\n get(): Observable<NbAuthToken> {\n const token = this.tokenStorage.get()\n return observableOf(token)\n }\n\n /** Removes the token. */\n clear(): Observable<void> {\n this.tokenStorage.clear()\n this.publishStoredToken()\n return observableOf(undefined)\n }\n\n protected publishStoredToken() {\n this.token$.next(this.tokenStorage.get())\n }\n}\n","import { inject, Service } from '@angular/core'\n\nimport { Observable, of as observableOf } from 'rxjs'\nimport { switchMap, map } from 'rxjs/operators'\n\nimport { NbAuthStrategy } from '../strategies/auth-strategy'\nimport { NB_AUTH_STRATEGIES } from '../auth.options'\nimport { NbAuthResult } from './auth-result'\nimport { NbTokenService } from './token/token.service'\nimport { NbAuthToken } from './token/token'\nimport { NbTokenStorageOptions } from './token/token-storage'\n\n/** The \"remember me\" of a login form's data, if it has one. */\nfunction rememberMe(data: unknown): boolean | undefined {\n return typeof data === 'object' && data !== null && 'rememberMe' in data && typeof data.rememberMe === 'boolean'\n ? data.rememberMe\n : undefined\n}\n\n/**\n * Signs in, up and out with a named strategy, and keeps the token it gets in the token storage; the auth components\n * go through it rather than a strategy.\n */\n@Service({ autoProvided: false })\nexport class NbAuthService {\n protected readonly tokenService = inject(NbTokenService)\n protected readonly strategies = inject(NB_AUTH_STRATEGIES)\n\n /** The stored token; an empty one of the fallback class when there's none. */\n getToken(): Observable<NbAuthToken> {\n return this.tokenService.get()\n }\n\n /** Whether the stored token is valid. */\n isAuthenticated(): Observable<boolean> {\n return this.getToken()\n .pipe(map((token: NbAuthToken) => token.isValid()))\n }\n\n /**\n * Whether the stored token is valid, after refreshing it with its strategy when it has a value but isn't valid, e.g.\n * has expired.\n */\n isAuthenticatedOrRefresh(): Observable<boolean> {\n return this.getToken()\n .pipe(\n switchMap((token) => {\n if (token.getValue() && !token.isValid()) {\n return this.refreshToken(token.getOwnerStrategyName(), token)\n .pipe(\n switchMap((res) => {\n if (res.isSuccess()) {\n return this.isAuthenticated()\n } else {\n return observableOf(false)\n }\n })\n )\n } else {\n return observableOf(token.isValid())\n }\n }))\n }\n\n /** The token, now and whenever it's set or cleared, also from another tab. */\n onTokenChange(): Observable<NbAuthToken> {\n return this.tokenService.tokenChange()\n }\n\n /** Whether the token is valid, now and whenever it changes. */\n onAuthenticationChange(): Observable<boolean> {\n return this.onTokenChange()\n .pipe(map((token: NbAuthToken) => token.isValid()))\n }\n\n /**\n * Signs in with the strategy, and keeps the token it gets. A `rememberMe` in `data`, as the login form sends, tells\n * whether the token outlives the browser session; without it the token stays where the current one is, or is\n * remembered.\n *\n * @param data what the strategy takes, such as the login form's `NbAuthCredentials`\n */\n authenticate(strategyName: string, data?: unknown): Observable<NbAuthResult> {\n return this.getStrategy(strategyName).authenticate(data)\n .pipe(\n switchMap((result: NbAuthResult) =>\n // The login form's \"remember me\": without it the token is remembered, as after a redirect.\n this.processResultToken(result, { remember: rememberMe(data) })\n )\n )\n }\n\n /** Registers with the strategy, and keeps the token it gets. */\n register(strategyName: string, data?: unknown): Observable<NbAuthResult> {\n return this.getStrategy(strategyName).register(data)\n .pipe(\n switchMap((result: NbAuthResult) => this.processResultToken(result))\n )\n }\n\n /** Signs out with the strategy, and clears the token when that succeeds. */\n logout(strategyName: string): Observable<NbAuthResult> {\n return this.getStrategy(strategyName).logout()\n .pipe(\n switchMap((result: NbAuthResult) => {\n if (result.isSuccess()) {\n return this.tokenService.clear().pipe(map(() => result))\n }\n return observableOf(result)\n })\n )\n }\n\n /** Asks the strategy to send the password reset instructions, e.g. to the email in `data`. */\n requestPassword(strategyName: string, data?: unknown): Observable<NbAuthResult> {\n return this.getStrategy(strategyName).requestPassword(data)\n }\n\n /** Sets a new password with the strategy, from `data`, e.g. the reset password form's. */\n resetPassword(strategyName: string, data?: unknown): Observable<NbAuthResult> {\n return this.getStrategy(strategyName).resetPassword(data)\n }\n\n /** Refreshes the token with the strategy, e.g. given the current token, and keeps the one it gets. */\n refreshToken(strategyName: string, data?: unknown): Observable<NbAuthResult> {\n return this.getStrategy(strategyName).refreshToken(data)\n .pipe(\n switchMap((result: NbAuthResult) => this.processResultToken(result))\n )\n }\n\n /** The strategy set up under the name; throws when there's none. */\n protected getStrategy(strategyName: string): NbAuthStrategy {\n const found = this.strategies.find((strategy: NbAuthStrategy) => strategy.getName() === strategyName)\n\n if (!found) {\n throw new TypeError(`There is no Auth Strategy registered under '${strategyName}' name`)\n }\n\n return found\n }\n\n private processResultToken(result: NbAuthResult, options?: NbTokenStorageOptions) {\n const token = result.getToken()\n if (result.isSuccess() && token) {\n return this.tokenService.set(token, options)\n .pipe(\n map(() => result)\n )\n }\n\n return observableOf(result)\n }\n}\n","import { injectNbTexts, NbLocalize } from '@liquid-js/lyr-core'\n\n/** @internal */\ndeclare const $localize: NbLocalize\n\n/**\n * The texts of the authentication pages. `provideNbTexts({ auth: { ... } })` changes them, and they're translated\n * with Angular's i18n, as `$localize` messages with ids like `@@nb.auth.loginTitle`.\n */\nexport interface NbAuthTexts {\n /** Label of the link back from the authentication pages. */\n back: string\n /** Shown while logging out. */\n loggingOut: string\n /** Heads the errors of a request. */\n errorTitle: string\n /** Heads the messages of a successful request. */\n successTitle: string\n /** Names the links to sign in with other services. */\n socialLabel: string\n /** Before the links to sign in with other services. */\n socialPrompt: string\n\n emailLabel: string\n emailPlaceholder: string\n emailRequired: string\n emailInvalid: string\n passwordLabel: string\n passwordPlaceholder: string\n passwordRequired: string\n /** Given the shortest and the longest password. */\n passwordLength: (min: number, max: number) => string\n fullNameLabel: string\n fullNamePlaceholder: string\n fullNameRequired: string\n /** Given the shortest and the longest name. */\n fullNameLength: (min: number, max: number) => string\n confirmPasswordPlaceholder: string\n confirmPasswordRequired: string\n passwordMismatch: string\n\n loginTitle: string\n loginSubtitle: string\n forgotPassword: string\n rememberMe: string\n loginSubmit: string\n /** Before the link to the registration page. */\n noAccount: string\n /** The link to the registration page. */\n registerLink: string\n\n registerTitle: string\n /** Label of the password confirmation on the registration page. */\n repeatPasswordLabel: string\n /** Before the link to the terms. */\n agreeTo: string\n terms: string\n registerSubmit: string\n /** Before the link to the login page. */\n haveAccount: string\n /** The link to the login page. */\n loginLink: string\n /** Names the links to the login page. */\n signInLabel: string\n\n requestPasswordTitle: string\n requestPasswordSubtitle: string\n requestPasswordEmailLabel: string\n requestPasswordSubmit: string\n /** The link back to the login page. */\n backToLogin: string\n /** Names the links to the login and registration pages. */\n signInOrUpLabel: string\n\n resetPasswordTitle: string\n resetPasswordSubtitle: string\n newPasswordLabel: string\n newPasswordPlaceholder: string\n /** Label of the password confirmation when the password is changed. */\n confirmPasswordLabel: string\n resetPasswordSubmit: string\n}\n\n/**\n * The messages of authentication strategies, shown on the authentication pages. Options given to a strategy's\n * `setup`, e.g. `login.defaultErrors`, are used over them.\n */\nexport interface NbAuthStrategyTexts {\n /** When logging in fails. */\n loginError: string\n /** When a request fails. */\n error: string\n /** When a request fails and there's nothing more to tell. */\n unknownError: string\n /** When a token from the backend isn't valid. */\n invalidToken: string\n /** When a sign-in redirect comes back without the state this browser sent, e.g. one it didn't start. */\n invalidState: string\n loginSuccess: string\n registerSuccess: string\n requestPasswordSuccess: string\n resetPasswordSuccess: string\n logoutSuccess: string\n refreshTokenSuccess: string\n authenticateSuccess: string\n}\n\ndeclare module '@liquid-js/lyr-core' {\n interface NbTexts {\n auth: NbAuthTexts\n authStrategy: NbAuthStrategyTexts\n }\n}\n\n/** The texts of the authentication pages. @internal */\nexport function injectNbAuthTexts() {\n return injectNbTexts('auth', () => ({\n back: $localize`:@@nb.auth.back:Back`,\n loggingOut: $localize`:@@nb.auth.loggingOut:Logging out, please wait...`,\n errorTitle: $localize`:@@nb.auth.errorTitle:Oh snap!`,\n successTitle: $localize`:@@nb.auth.successTitle:Hooray!`,\n socialLabel: $localize`:@@nb.auth.socialLabel:Social sign in`,\n socialPrompt: $localize`:@@nb.auth.socialPrompt:or enter with:`,\n\n emailLabel: $localize`:@@nb.auth.emailLabel:Email address:`,\n emailPlaceholder: $localize`:@@nb.auth.emailPlaceholder:Email address`,\n emailRequired: $localize`:@@nb.auth.emailRequired:Email is required!`,\n emailInvalid: $localize`:@@nb.auth.emailInvalid:Email should be the real one!`,\n passwordLabel: $localize`:@@nb.auth.passwordLabel:Password:`,\n passwordPlaceholder: $localize`:@@nb.auth.passwordPlaceholder:Password`,\n passwordRequired: $localize`:@@nb.auth.passwordRequired:Password is required!`,\n passwordLength: (min, max) =>\n $localize`:@@nb.auth.passwordLength:Password should contain from ${min}:min: to ${max}:max: characters`,\n fullNameLabel: $localize`:@@nb.auth.fullNameLabel:Full name:`,\n fullNamePlaceholder: $localize`:@@nb.auth.fullNamePlaceholder:Full name`,\n fullNameRequired: $localize`:@@nb.auth.fullNameRequired:Full name is required!`,\n fullNameLength: (min, max) =>\n $localize`:@@nb.auth.fullNameLength:Full name should contain from ${min}:min: to ${max}:max: characters`,\n confirmPasswordPlaceholder: $localize`:@@nb.auth.confirmPasswordPlaceholder:Confirm Password`,\n confirmPasswordRequired: $localize`:@@nb.auth.confirmPasswordRequired:Password confirmation is required!`,\n passwordMismatch: $localize`:@@nb.auth.passwordMismatch:Password does not match the confirm password.`,\n\n loginTitle: $localize`:@@nb.auth.loginTitle:Login`,\n loginSubtitle: $localize`:@@nb.auth.loginSubtitle:Hello! Log in with your email.`,\n forgotPassword: $localize`:@@nb.auth.forgotPassword:Forgot Password?`,\n rememberMe: $localize`:@@nb.auth.rememberMe:Remember me`,\n loginSubmit: $localize`:@@nb.auth.loginSubmit:Log In`,\n noAccount: $localize`:@@nb.auth.noAccount:Don't have an account?`,\n registerLink: $localize`:@@nb.auth.registerLink:Register`,\n\n registerTitle: $localize`:@@nb.auth.registerTitle:Register`,\n repeatPasswordLabel: $localize`:@@nb.auth.repeatPasswordLabel:Repeat password:`,\n agreeTo: $localize`:@@nb.auth.agreeTo:Agree to`,\n terms: $localize`:@@nb.auth.terms:Terms & Conditions`,\n registerSubmit: $localize`:@@nb.auth.registerSubmit:Register`,\n haveAccount: $localize`:@@nb.auth.haveAccount:Already have an account?`,\n loginLink: $localize`:@@nb.auth.loginLink:Log in`,\n signInLabel: $localize`:@@nb.auth.signInLabel:Sign in`,\n\n requestPasswordTitle: $localize`:@@nb.auth.requestPasswordTitle:Forgot Password`,\n requestPasswordSubtitle: $localize`:@@nb.auth.requestPasswordSubtitle:Enter your email address and we’ll send a link to reset your password`,\n requestPasswordEmailLabel: $localize`:@@nb.auth.requestPasswordEmailLabel:Enter your email address:`,\n requestPasswordSubmit: $localize`:@@nb.auth.requestPasswordSubmit:Request password`,\n backToLogin: $localize`:@@nb.auth.backToLogin:Back to Log In`,\n signInOrUpLabel: $localize`:@@nb.auth.signInOrUpLabel:Sign in or sign up`,\n\n resetPasswordTitle: $localize`:@@nb.auth.resetPasswordTitle:Change password`,\n resetPasswordSubtitle: $localize`:@@nb.auth.resetPasswordSubtitle:Please set a new password`,\n newPasswordLabel: $localize`:@@nb.auth.newPasswordLabel:New Password:`,\n newPasswordPlaceholder: $localize`:@@nb.auth.newPasswordPlaceholder:New Password`,\n confirmPasswordLabel: $localize`:@@nb.auth.confirmPasswordLabel:Confirm Password:`,\n resetPasswordSubmit: $localize`:@@nb.auth.resetPasswordSubmit:Change password`\n }))\n}\n\n/** The messages of authentication strategies. @internal */\nexport function injectNbAuthStrategyTexts() {\n return injectNbTexts('authStrategy', () => ({\n loginError: $localize`:@@nb.authStrategy.loginError:Login/Email combination is not correct, please try again.`,\n error: $localize`:@@nb.authStrategy.error:Something went wrong, please try again.`,\n unknownError: $localize`:@@nb.authStrategy.unknownError:Something went wrong.`,\n invalidToken: $localize`:@@nb.authStrategy.invalidToken:Token is empty or invalid.`,\n invalidState: $localize`:@@nb.authStrategy.invalidState:This sign-in couldn't be verified, please try again.`,\n loginSuccess: $localize`:@@nb.authStrategy.loginSuccess:You have been successfully logged in.`,\n registerSuccess: $localize`:@@nb.authStrategy.registerSuccess:You have been successfully registered.`,\n requestPasswordSuccess: $localize`:@@nb.authStrategy.requestPasswordSuccess:Reset password instructions have been sent to your email.`,\n resetPasswordSuccess: $localize`:@@nb.authStrategy.resetPasswordSuccess:Your password has been successfully changed.`,\n logoutSuccess: $localize`:@@nb.authStrategy.logoutSuccess:You have been successfully logged out.`,\n refreshTokenSuccess: $localize`:@@nb.authStrategy.refreshTokenSuccess:Your token has been successfully refreshed.`,\n authenticateSuccess: $localize`:@@nb.authStrategy.authenticateSuccess:You have been successfully authenticated.`\n }))\n}\n","import { computed, signal } from '@angular/core'\nimport { HttpHeaders, HttpResponse } from '@angular/common/http'\nimport { Observable } from 'rxjs'\nimport { NbAuthResult } from '../services/auth-result'\nimport { deepExtend, getDeepFromObject, NbAuthDeepPartial, NbPath, NbPathValue } from '../helpers'\nimport { NbAuthToken, nbAuthCreateToken, NbAuthIllegalTokenError } from '../services/token/token'\nimport { injectNbAuthStrategyTexts } from '../texts'\nimport { NbAuthStrategyOptions } from './auth-strategy-options'\n\n/**\n * The base of the auth strategies. `O` is the strategy's options class, which types `getOption`.\n */\nexport abstract class NbAuthStrategy<O extends NbAuthStrategyOptions = NbAuthStrategyOptions> {\n protected defaultOptions?: O\n /** The default messages, from `NbTextsService`. */\n protected readonly texts = injectNbAuthStrategyTexts()\n /** The options the strategy was set up with, over its defaults and texts. */\n protected readonly givenOptions = signal<NbAuthDeepPartial<O> | undefined>(undefined)\n // Computed, so texts set at run time reach the strategy's default messages.\n protected readonly resolvedOptions = computed(() => {\n const given = this.givenOptions()\n return given === undefined ? undefined : (deepExtend({}, this.defaultOptions, this.textOptions(), given) as O)\n })\n\n /** The strategy's options: its defaults, the default messages from the texts, and the options it was given. */\n protected get options(): O | undefined {\n return this.resolvedOptions()\n }\n\n /** Sets the options the strategy works with, over its defaults; they can be partial. */\n setOptions(options: NbAuthDeepPartial<O>) {\n this.givenOptions.set(options)\n }\n\n /**\n * The default messages of the strategy's actions, from `NbTextsService`, over the defaults of its options and under\n * the options it's given.\n */\n protected textOptions(): object {\n const texts = this.texts()\n const messages: Record<string, [string, string]> = {\n login: [texts.loginError, texts.loginSuccess],\n authenticate: [texts.error, texts.authenticateSuccess],\n register: [texts.error, texts.registerSuccess],\n requestPass: [texts.error, texts.requestPasswordSuccess],\n requestPassword: [texts.error, texts.requestPasswordSuccess],\n resetPass: [texts.error, texts.resetPasswordSuccess],\n resetPassword: [texts.error, texts.resetPasswordSuccess],\n logout: [texts.error, texts.logoutSuccess],\n refreshToken: [texts.error, texts.refreshTokenSuccess]\n }\n const defaults = (this.defaultOptions ?? {}) as unknown as Record<string, unknown>\n return Object.fromEntries(\n Object.entries(messages)\n .filter(([module]) => typeof defaults[module] === 'object' && defaults[module] !== null)\n .map(([module, [error, message]]) => [module, { defaultErrors: [error], defaultMessages: [message] }])\n )\n }\n\n /**\n * The option at a dotted path, such as `'login.redirect.success'`, typed by the strategy's options class; `undefined`\n * before the options are set.\n */\n getOption<P extends NbPath<O>>(key: P): NbPathValue<O | undefined, P> {\n return getDeepFromObject(this.options, key)\n }\n\n /**\n * Creates a token of the options' token class from a value, e.g. a response; with `failWhenInvalidToken`, an\n * invalid one throws.\n */\n createToken(value: unknown, failWhenInvalidToken?: boolean): NbAuthToken {\n const tokenClass = this.options?.token?.class\n if (!tokenClass) {\n throw new TypeError(`The '${this.getName()}' strategy has no token class.`)\n }\n const token = nbAuthCreateToken(tokenClass, value, this.getName())\n // A token class throws NbAuthIllegalTokenError for a value it can't read, which the strategies handle; a token it\n // makes may still be invalid, e.g. when the backend returned none.\n if (failWhenInvalidToken && !token.isValid()) {\n // Thrown as the same error, so the strategies handle both the same way.\n throw new NbAuthIllegalTokenError(this.texts().invalidToken)\n }\n return token\n }\n\n getName(): string {\n return this.options?.name ?? ''\n }\n\n // The data each action takes is the strategy's own: each strategy declares the shape it reads.\n\n abstract authenticate(data?: unknown): Observable<NbAuthResult>\n\n abstract register(data?: unknown): Observable<NbAuthResult>\n\n abstract requestPassword(data?: unknown): Observable<NbAuthResult>\n\n abstract resetPassword(data?: unknown): Observable<NbAuthResult>\n\n abstract logout(): Observable<NbAuthResult>\n\n abstract refreshToken(data?: unknown): Observable<NbAuthResult>\n\n protected createFailResponse(_data?: unknown): HttpResponse<unknown> {\n return new HttpResponse<unknown>({ body: {}, status: 401 })\n }\n\n protected createSuccessResponse(_data?: unknown): HttpResponse<unknown> {\n return new HttpResponse<unknown>({ body: {}, status: 200 })\n }\n\n /** The URL of an action: its `endpoint` after the options' `baseEndpoint`, or none without an endpoint. */\n protected getActionEndpoint(action: string): string {\n const actionEndpoint = getDeepFromObject(this.options, `${action}.endpoint`)\n const baseEndpoint = getDeepFromObject(this.options, 'baseEndpoint')\n return actionEndpoint ? `${baseEndpoint}${actionEndpoint}` : ''\n }\n\n protected getHeaders(): HttpHeaders {\n const customHeaders = this.options?.headers ?? {}\n if (customHeaders instanceof HttpHeaders) {\n return customHeaders\n }\n\n let headers = new HttpHeaders()\n Object.entries(customHeaders).forEach(([key, value]) => {\n headers = headers.append(key, value)\n })\n return headers\n }\n}\n","import { NbAuthToken } from './token/token'\n\n/** What an `NbAuthResult` holds, for `NbAuthResult.from`. */\nexport interface NbAuthResultOptions<R = unknown> {\n success: boolean\n /** What the backend answered, or the error the action failed with. */\n response?: R\n /** Where to go next; `null`, as the strategies' options use for a redirect they don't want, is none. */\n redirect?: string | null\n errors?: string[]\n messages?: string[]\n token?: NbAuthToken\n}\n\n/**\n * The outcome of a strategy's action. `R` is the strategy's response: what its backend answered, or the error it failed\n * with.\n */\nexport class NbAuthResult<R = unknown> {\n\n protected token?: NbAuthToken\n protected redirect?: string\n protected errors = new Array<string>()\n protected messages = new Array<string>()\n\n /**\n * A result from named options, which reads better than the constructor's positional ones:\n *\n * ```ts\n * NbAuthResult.from({ success: true, response, redirect: '/dashboard', messages: ['Signed in.'], token });\n * ```\n */\n static from<R>(options: NbAuthResultOptions<R>): NbAuthResult<R> {\n const { success, response, redirect, errors, messages, token } = options\n return new NbAuthResult(success, response, redirect, errors, messages, token)\n }\n\n /**\n * @param redirect where to go next; `null`, as the strategies' options use for a redirect they don't want, is none\n */\n constructor(protected success: boolean,\n protected response?: R,\n redirect?: string | null,\n errors?: string[],\n messages?: string[],\n token?: NbAuthToken) {\n\n this.redirect = redirect ?? undefined\n this.errors = errors ?? []\n this.messages = messages ?? []\n this.token = token\n }\n\n getResponse(): R | undefined {\n return this.response\n }\n\n getToken(): NbAuthToken | undefined {\n return this.token\n }\n\n getRedirect(): string | undefined {\n return this.redirect\n }\n\n getErrors(): string[] {\n return this.errors.filter((val) => !!val)\n }\n\n getMessages(): string[] {\n return this.messages.filter((val) => !!val)\n }\n\n isSuccess(): boolean {\n return this.success\n }\n\n isFailure(): boolean {\n return !this.success\n }\n}\n","import { HttpHeaders } from '@angular/common/http'\nimport { NbAuthTokenClass } from '../services/token/token'\n\nexport interface NbStrategyToken {\n class?: NbAuthTokenClass\n [key: string]: unknown\n}\n\nexport class NbAuthStrategyOptions {\n name = ''\n token?: NbStrategyToken\n headers?: HttpHeaders | { [header: string]: string | string[] }\n}\n","import { NbAuthStrategyOptions, NbStrategyToken } from '../auth-strategy-options'\nimport { NbAuthSimpleToken } from '../../services/token/token'\n\nexport class NbDummyAuthStrategyOptions extends NbAuthStrategyOptions {\n override token?: NbStrategyToken = {\n class: NbAuthSimpleToken\n }\n delay?: number = 1000\n alwaysFail?: boolean = false\n}\n\nexport const dummyStrategyOptions: NbDummyAuthStrategyOptions = new NbDummyAuthStrategyOptions()\n","import { Service } from '@angular/core'\nimport { HttpResponse } from '@angular/common/http'\n\nimport { Observable, of as observableOf } from 'rxjs'\nimport { delay } from 'rxjs/operators'\n\nimport { NbAuthStrategy } from '../auth-strategy'\nimport { NbAuthResult } from '../../services/auth-result'\nimport { NbAuthStrategyClass } from '../../auth.options'\nimport { NbDummyAuthStrategyOptions, dummyStrategyOptions } from './dummy-strategy-options'\n\n/**\n * A strategy without a backend, for setting up the auth before there is one: every action succeeds after `delay`\n * milliseconds with a simple token and a redirect to `/`, or fails when `alwaysFail` is set.\n *\n * Strategy settings:\n *\n * ```ts\n * export class NbDummyAuthStrategyOptions extends NbAuthStrategyOptions {\n * name = '';\n * token?: NbStrategyToken = {\n * class: NbAuthSimpleToken,\n * };\n * delay?: number = 1000;\n * alwaysFail?: boolean = false;\n * }\n * ```\n */\n@Service({ autoProvided: false })\nexport class NbDummyAuthStrategy extends NbAuthStrategy<NbDummyAuthStrategyOptions> {\n protected override defaultOptions: NbDummyAuthStrategyOptions = dummyStrategyOptions\n\n static setup(options: NbDummyAuthStrategyOptions): [NbAuthStrategyClass, NbDummyAuthStrategyOptions] {\n return [NbDummyAuthStrategy, options]\n }\n\n authenticate(data?: unknown): Observable<NbAuthResult<HttpResponse<unknown>>> {\n return observableOf(this.createDummyResult(data)).pipe(delay(this.getOption('delay') ?? 0))\n }\n\n register(data?: unknown): Observable<NbAuthResult<HttpResponse<unknown>>> {\n return observableOf(this.createDummyResult(data)).pipe(delay(this.getOption('delay') ?? 0))\n }\n\n requestPassword(data?: unknown): Observable<NbAuthResult<HttpResponse<unknown>>> {\n return observableOf(this.createDummyResult(data)).pipe(delay(this.getOption('delay') ?? 0))\n }\n\n resetPassword(data?: unknown): Observable<NbAuthResult<HttpResponse<unknown>>> {\n return observableOf(this.createDummyResult(data)).pipe(delay(this.getOption('delay') ?? 0))\n }\n\n logout(data?: unknown): Observable<NbAuthResult<HttpResponse<unknown>>> {\n return observableOf(this.createDummyResult(data)).pipe(delay(this.getOption('delay') ?? 0))\n }\n\n refreshToken(data?: unknown): Observable<NbAuthResult<HttpResponse<unknown>>> {\n return observableOf(this.createDummyResult(data)).pipe(delay(this.getOption('delay') ?? 0))\n }\n\n protected createDummyResult(data?: unknown): NbAuthResult<HttpResponse<unknown>> {\n if (this.getOption('alwaysFail')) {\n return new NbAuthResult(false, this.createFailResponse(data), undefined, [this.texts().unknownError])\n }\n\n try {\n const token = this.createToken('test token', true)\n return new NbAuthResult(true, this.createSuccessResponse(data), '/', [], [this.texts().loginSuccess], token)\n } catch (err) {\n return new NbAuthResult(false, this.createFailResponse(data), undefined, [(err as Error).message])\n }\n }\n}\n","import { NbAuthOAuth2Token, NbAuthTokenClass } from '../../services/token/token'\nimport { NbAuthStrategyOptions } from '../auth-strategy-options'\n\nexport enum NbOAuth2ResponseType {\n CODE = 'code',\n TOKEN = 'token'\n}\n\nexport enum NbOAuth2GrantType {\n AUTHORIZATION_CODE = 'authorization_code',\n PASSWORD = 'password',\n REFRESH_TOKEN = 'refresh_token'\n}\n\nexport enum NbOAuth2ClientAuthMethod {\n NONE = 'none',\n BASIC = 'basic',\n REQUEST_BODY = 'request-body'\n}\n\nexport class NbOAuth2AuthStrategyOptions extends NbAuthStrategyOptions {\n baseEndpoint?: string = ''\n clientId = ''\n clientSecret?: string = ''\n clientAuthMethod?: string = NbOAuth2ClientAuthMethod.NONE\n /** Where to go after signing in; `null` turns a default redirect off, while a missing one keeps the default. */\n redirect?: { success?: string | null, failure?: string | null } = {\n success: '/',\n failure: null\n }\n defaultErrors?: string[] = ['Something went wrong, please try again.']\n defaultMessages?: string[] = ['You have been successfully authenticated.']\n authorize?: {\n endpoint?: string\n redirectUri?: string\n responseType?: string\n requireValidToken?: boolean // used only with NbOAuth2ResponseType.TOKEN\n scope?: string\n /** A state of the app's to send, and check on the way back; a random one per sign-in without it. */\n state?: string\n /** Whether the code flow uses PKCE (RFC 7636), with an S256 challenge; on unless `false`. */\n pkce?: boolean\n params?: { [key: string]: string }\n } = {\n endpoint: 'authorize',\n responseType: NbOAuth2ResponseType.CODE,\n requireValidToken: true,\n pkce: true\n }\n override token?: {\n endpoint?: string\n grantType?: string\n redirectUri?: string\n scope?: string // Used only with 'password' grantType\n requireValidToken?: boolean\n class: NbAuthTokenClass\n } = {\n endpoint: 'token',\n grantType: NbOAuth2GrantType.AUTHORIZATION_CODE,\n requireValidToken: true,\n class: NbAuthOAuth2Token\n }\n refresh?: {\n endpoint?: string\n grantType?: string\n scope?: string\n requireValidToken?: boolean\n } = {\n endpoint: 'token',\n grantType: NbOAuth2GrantType.REFRESH_TOKEN,\n requireValidToken: true\n }\n}\n\nexport const auth2StrategyOptions: NbOAuth2AuthStrategyOptions = new NbOAuth2AuthStrategyOptions()\n","import { inject, Service } from '@angular/core'\nimport { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http'\nimport { ActivatedRoute, Params } from '@angular/router'\nimport { Observable, of as observableOf } from 'rxjs'\nimport { switchMap, map, catchError } from 'rxjs/operators'\nimport { NB_WINDOW } from '@liquid-js/lyr-core'\n\nimport { NbAuthStrategy } from '../auth-strategy'\nimport { NbAuthIllegalTokenError, NbAuthRefreshableToken, NbAuthToken } from '../../services/token/token'\nimport { NbAuthResult } from '../../services/auth-result'\nimport { NbAuthStrategyClass } from '../../auth.options'\nimport { NbAuthCredentials } from '../../models/user'\nimport {\n NbOAuth2AuthStrategyOptions,\n NbOAuth2ResponseType,\n auth2StrategyOptions,\n NbOAuth2GrantType,\n NbOAuth2ClientAuthMethod\n} from './oauth2-strategy.options'\n\n/** The state, and the PKCE verifier, of a sign-in on its way to the server and back. */\ninterface NbOAuth2PendingAuthorization {\n state: string\n verifier?: string\n}\n\n/** Whether a token can be refreshed: has a refresh token to read and set. */\nfunction isRefreshableToken(token: NbAuthToken): token is NbAuthToken & NbAuthRefreshableToken {\n return 'getRefreshToken' in token && 'setRefreshToken' in token\n}\n\n/** Bytes as base64url, without padding. */\nfunction base64url(bytes: Uint8Array) {\n return btoa(String.fromCharCode(...bytes))\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=+$/, '')\n}\n\n/** A random string of `bytes` random bytes. */\nfunction randomString(bytes: number) {\n return base64url(crypto.getRandomValues(new Uint8Array(bytes)))\n}\n\n/** A verifier's PKCE challenge: S256, or `plain` where Web Crypto isn't there (pages not served over HTTPS). */\nasync function pkceChallenge(verifier: string): Promise<{ challenge: string, method: 'S256' | 'plain' }> {\n if (!globalThis.crypto?.subtle) {\n return { challenge: verifier, method: 'plain' }\n }\n const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(verifier))\n return { challenge: base64url(new Uint8Array(digest)), method: 'S256' }\n}\n\n/**\n * Signs in with an OAuth2 server. `authenticate` sends the browser to the `authorize` endpoint and, when it comes\n * back with a code (or with a token, with `responseType: 'token'`), gets the token from the `token` endpoint; with\n * the password grant it posts the email and password to `token` instead. `refreshToken` posts the refresh token to\n * `refresh`. `register`, `requestPassword` and `resetPassword` aren't supported.\n *\n * Strategy settings; `setup` takes the ones to change, over these defaults. `defaultErrors` and `defaultMessages` are\n * the `authStrategy` texts (`provideNbTexts`), unless the given options set them:\n *\n * ```ts\n * export enum NbOAuth2ResponseType {\n * CODE = 'code',\n * TOKEN = 'token',\n * }\n *\n * export enum NbOAuth2GrantType {\n * AUTHORIZATION_CODE = 'authorization_code',\n * PASSWORD = 'password',\n * REFRESH_TOKEN = 'refresh_token',\n * }\n *\n * export enum NbOAuth2ClientAuthMethod {\n * NONE = 'none',\n * BASIC = 'basic',\n * REQUEST_BODY = 'request-body',\n * }\n *\n * export class NbOAuth2AuthStrategyOptions extends NbAuthStrategyOptions {\n * name = '';\n * baseEndpoint?: string = '';\n * clientId = '';\n * clientSecret?: string = '';\n * clientAuthMethod?: string = NbOAuth2ClientAuthMethod.NONE;\n * redirect?: { success?: string | null; failure?: string | null } = {\n * success: '/',\n * failure: null,\n * };\n * defaultErrors?: string[] = ['Something went wrong, please try again.'];\n * defaultMessages?: string[] = ['You have been successfully authenticated.'];\n * authorize?: {\n * endpoint?: string;\n * redirectUri?: string;\n * responseType?: string;\n * requireValidToken?: boolean; // used only with NbOAuth2ResponseType.TOKEN\n * scope?: string;\n * state?: string;\n * pkce?: boolean;\n * params?: { [key: string]: string };\n * } = {\n * endpoint: 'authorize',\n * responseType: NbOAuth2ResponseType.CODE,\n * requireValidToken: true,\n * pkce: true,\n * };\n * token?: {\n * endpoint?: string;\n * grantType?: string;\n * redirectUri?: string;\n * scope?: string; // used only with the password grant\n * requireValidToken?: boolean;\n * class: NbAuthTokenClass;\n * } = {\n * endpoint: 'token',\n * grantType: NbOAuth2GrantType.AUTHORIZATION_CODE,\n * requireValidToken: true,\n * class: NbAuthOAuth2Token,\n * };\n * refresh?: {\n * endpoint?: string;\n * grantType?: string;\n * scope?: string;\n * requireValidToken?: boolean;\n * } = {\n * endpoint: 'token',\n * grantType: NbOAuth2GrantType.REFRESH_TOKEN,\n * requireValidToken: true,\n * };\n * }\n * ```\n *\n * With `clientAuthMethod` `basic` the client id and secret go in a Basic authorization header, with `request-body`\n * in the token requests' body; both need `clientId` and `clientSecret`.\n *\n * The code flow uses PKCE (RFC 7636): a random verifier per sign-in, its S256 challenge on the redirect to\n * `authorize`, and the verifier with the code to `token`; `authorize.pkce: false` turns it off. Every redirect sends a\n * state, random unless `authorize.state` sets one, and the way back is refused unless it brings the same state, so a\n * sign-in this browser didn't start can't complete. Both are kept in `sessionStorage` while the browser is away.\n */\n@Service({ autoProvided: false })\nexport class NbOAuth2AuthStrategy extends NbAuthStrategy<NbOAuth2AuthStrategyOptions> {\n // The messages are the options' own, not their actions'.\n protected override textOptions(): object {\n const texts = this.texts()\n return { defaultErrors: [texts.error], defaultMessages: [texts.authenticateSuccess] }\n }\n\n protected readonly http = inject(HttpClient)\n protected readonly route = inject(ActivatedRoute)\n protected readonly window = inject(NB_WINDOW)\n\n static setup(options: NbOAuth2AuthStrategyOptions): [NbAuthStrategyClass, NbOAuth2AuthStrategyOptions] {\n return [NbOAuth2AuthStrategy, options]\n }\n\n get responseType() {\n return this.getOption('authorize.responseType')\n }\n\n get clientAuthMethod() {\n return this.getOption('clientAuthMethod')\n }\n\n protected redirectResultHandlers: { [key: string]: () => Observable<NbAuthResult> } = {\n [NbOAuth2ResponseType.CODE]: () => observableOf(this.route.snapshot.queryParams).pipe(\n switchMap((params: Params) => {\n const pending = this.takePendingAuthorization()\n const code: unknown = params['code']\n if (code) {\n if (!pending || pending.state !== params['state']) {\n return observableOf(this.invalidStateResult(params))\n }\n return this.requestToken(String(code), pending.verifier)\n }\n\n return observableOf(\n new NbAuthResult(false, params, this.getOption('redirect.failure'), this.getOption('defaultErrors'), [])\n )\n })\n ),\n [NbOAuth2ResponseType.TOKEN]: () => {\n const module = 'authorize'\n const requireValidToken = this.getOption(`${module}.requireValidToken`)\n return observableOf(this.route.snapshot.fragment).pipe(\n map((fragment) => this.parseHashAsQueryParams(fragment)),\n map((params) => {\n const pending = this.takePendingAuthorization()\n if (!params['error'] && (!pending || pending.state !== params['state'])) {\n return this.invalidStateResult(params)\n }\n if (!params['error']) {\n return new NbAuthResult(\n true,\n params,\n this.getOption('redirect.success'),\n [],\n this.getOption('defaultMessages'),\n this.createToken(params, requireValidToken)\n )\n }\n return new NbAuthResult(\n false,\n params,\n this.getOption('redirect.failure'),\n this.getOption('defaultErrors'),\n []\n )\n }),\n catchError((err: unknown) => {\n const errors = new Array<string>()\n if (err instanceof NbAuthIllegalTokenError) {\n errors.push(err.message)\n } else {\n errors.push(this.texts().unknownError)\n }\n return observableOf(new NbAuthResult(false, err, this.getOption('redirect.failure'), errors))\n })\n )\n }\n }\n\n protected redirectResults: { [key: string]: () => Observable<boolean> } = {\n [NbOAuth2ResponseType.CODE]: () => observableOf(this.route.snapshot.queryParams).pipe(\n map((params: Params) => !!(params && (params['code'] || params['error'])))\n ),\n [NbOAuth2ResponseType.TOKEN]: () => observableOf(this.route.snapshot.fragment).pipe(\n map((fragment) => this.parseHashAsQueryParams(fragment)),\n map((params) => !!(params && (params['access_token'] || params['error'])))\n )\n }\n\n protected override defaultOptions: NbOAuth2AuthStrategyOptions = auth2StrategyOptions\n\n /**\n * Sends the browser to sign in, or completes the sign-in it's back from; with the password grant, signs in with the\n * email and password.\n */\n authenticate(data?: Pick<NbAuthCredentials, 'email' | 'password'>): Observable<NbAuthResult> {\n if (this.getOption('token.grantType') === NbOAuth2GrantType.PASSWORD) {\n return this.passwordToken(data?.email ?? '', data?.password ?? '')\n } else {\n return this.isRedirectResult().pipe(\n switchMap((result: boolean) => {\n if (!result) {\n this.authorizeRedirect()\n return observableOf(new NbAuthResult(true))\n }\n return this.getAuthorizationResult()\n })\n )\n }\n }\n\n getAuthorizationResult(): Observable<NbAuthResult> {\n const redirectResultHandler = this.redirectResultHandlers[this.responseType ?? '']\n if (redirectResultHandler) {\n return redirectResultHandler.call(this)\n }\n\n throw new Error(`'${this.responseType}' responseType is not supported,\n only 'token' and 'code' are supported now`)\n }\n\n refreshToken(token: NbAuthRefreshableToken): Observable<NbAuthResult> {\n const module = 'refresh'\n const url = this.getActionEndpoint(module)\n const requireValidToken = this.getOption(`${module}.requireValidToken`)\n\n return this.http.post(url, this.buildRefreshRequestData(token), { headers: this.getHeaders() }).pipe(\n map((res) => new NbAuthResult(\n true,\n res,\n this.getOption('redirect.success'),\n [],\n this.getOption('defaultMessages'),\n this.createRefreshedToken(res, token, requireValidToken)\n )),\n catchError((res) => this.handleResponseError(res))\n )\n }\n\n passwordToken(username: string, password: string): Observable<NbAuthResult> {\n const module = 'token'\n const url = this.getActionEndpoint(module)\n const requireValidToken = this.getOption(`${module}.requireValidToken`)\n\n return this.http.post(url, this.buildPasswordRequestData(username, password), { headers: this.getHeaders() }).pipe(\n map((res) => new NbAuthResult(\n true,\n res,\n this.getOption('redirect.success'),\n [],\n this.getOption('defaultMessages'),\n this.createToken(res, requireValidToken)\n )),\n catchError((res) => this.handleResponseError(res))\n )\n }\n\n protected authorizeRedirect() {\n void this.startAuthorization().then((url) => {\n if (this.window) {\n this.window.location.href = url\n }\n })\n }\n\n /**\n * Starts a sign-in: makes its state and PKCE verifier, keeps them for the way back, and gives the URL to send the\n * browser to.\n */\n protected async startAuthorization(): Promise<string> {\n const state: string = this.getOption('authorize.state') || randomString(16)\n const pkce = this.responseType === NbOAuth2ResponseType.CODE && this.getOption('authorize.pkce') !== false\n const verifier = pkce ? randomString(32) : undefined\n const challenge = verifier ? await pkceChallenge(verifier) : undefined\n const pending: NbOAuth2PendingAuthorization = { state, ...(verifier && { verifier }) }\n this.sessionStorage()?.setItem(this.pendingKey(), JSON.stringify(pending))\n return this.buildRedirectUrl({\n state,\n ...(challenge && { code_challenge: challenge.challenge, code_challenge_method: challenge.method })\n })\n }\n\n /** The sign-in on its way back, which can be taken once. */\n protected takePendingAuthorization(): NbOAuth2PendingAuthorization | undefined {\n const storage = this.sessionStorage()\n const raw = storage?.getItem(this.pendingKey())\n storage?.removeItem(this.pendingKey())\n try {\n return raw ? (JSON.parse(raw) as NbOAuth2PendingAuthorization) : undefined\n } catch {\n return undefined\n }\n }\n\n protected pendingKey() {\n return `nb-oauth2-${this.getName() || 'oauth2'}`\n }\n\n protected sessionStorage(): Storage | undefined {\n try {\n return this.window?.sessionStorage\n } catch {\n // Storage the browser denies, e.g. with cookies blocked.\n return undefined\n }\n }\n\n protected invalidStateResult(params: unknown) {\n return new NbAuthResult(false, params, this.getOption('redirect.failure'), [this.texts().invalidState], [])\n }\n\n protected isRedirectResult(): Observable<boolean> {\n return this.redirectResults[this.responseType ?? ''].call(this)\n }\n\n protected requestToken(code: string, verifier?: string) {\n const module = 'token'\n const url = this.getActionEndpoint(module)\n const requireValidToken = this.getOption(`${module}.requireValidToken`)\n\n return this.http.post(url, this.buildCodeRequestData(code, verifier), { headers: this.getHeaders() }).pipe(\n map((res) => new NbAuthResult(\n true,\n res,\n this.getOption('redirect.success'),\n [],\n this.getOption('defaultMessages'),\n this.createToken(res, requireValidToken)\n )),\n catchError((res) => this.handleResponseError(res))\n )\n }\n\n protected buildCodeRequestData(code: string, verifier?: string): string {\n const params = {\n grant_type: this.getOption('token.grantType'),\n code,\n redirect_uri: this.getOption('token.redirectUri'),\n client_id: this.getOption('clientId'),\n code_verifier: verifier\n }\n return this.urlEncodeParameters(this.cleanParams(this.addCredentialsToParams(params)))\n }\n\n protected buildRefreshRequestData(token: NbAuthRefreshableToken): string {\n const params = {\n grant_type: this.getOption('refresh.grantType'),\n refresh_token: token.getRefreshToken(),\n scope: this.getOption('refresh.scope'),\n client_id: this.getOption('clientId')\n }\n return this.urlEncodeParameters(this.cleanParams(this.addCredentialsToParams(params)))\n }\n\n protected buildPasswordRequestData(username: string, password: string): string {\n const params = {\n grant_type: this.getOption('token.grantType'),\n username,\n password,\n scope: this.getOption('token.scope')\n }\n return this.urlEncodeParameters(this.cleanParams(this.addCredentialsToParams(params)))\n }\n\n protected buildAuthHeader(): HttpHeaders | undefined {\n if (this.clientAuthMethod === NbOAuth2ClientAuthMethod.BASIC) {\n if (this.getOption('clientId') && this.getOption('clientSecret')) {\n return new HttpHeaders({\n Authorization: 'Basic ' + btoa(this.getOption('clientId') + ':' + this.getOption('clientSecret'))\n })\n } else {\n throw Error('For basic client authentication method, please provide both clientId & clientSecret.')\n }\n }\n return undefined\n }\n\n protected override getHeaders(): HttpHeaders {\n let headers = super.getHeaders()\n headers = headers.append('Content-Type', 'application/x-www-form-urlencoded')\n\n const authHeaders = this.buildAuthHeader()\n if (authHeaders === undefined) {\n return headers\n }\n\n for (const headerKey of authHeaders.keys()) {\n for (const headerValue of authHeaders.getAll(headerKey) ?? []) {\n headers = headers.append(headerKey, headerValue)\n }\n }\n\n return headers\n }\n\n /** Removes the params without a value. */\n protected cleanParams(params: Record<string, unknown>): Record<string, unknown> {\n Object.entries(params).forEach(([key, val]) => !val && delete params[key])\n return params\n }\n\n protected addCredentialsToParams(params: Record<string, unknown>): Record<string, unknown> {\n if (this.clientAuthMethod === NbOAuth2ClientAuthMethod.REQUEST_BODY) {\n if (this.getOption('clientId') && this.getOption('clientSecret')) {\n return {\n ...params,\n client_id: this.getOption('clientId'),\n client_secret: this.getOption('clientSecret')\n }\n } else {\n throw Error('For request body client authentication method, please provide both clientId & clientSecret.')\n }\n }\n return params\n }\n\n protected handleResponseError(res: unknown): Observable<NbAuthResult> {\n let errors = new Array<string>()\n if (res instanceof HttpErrorResponse) {\n const error: unknown = res.error\n const description = typeof error === 'object' && error !== null && 'error_description' in error\n ? error.error_description\n : undefined\n if (description) {\n errors.push(String(description))\n } else {\n errors = this.getOption('defaultErrors') ?? []\n }\n } else if (res instanceof NbAuthIllegalTokenError) {\n errors.push(res.message)\n } else {\n errors.push(this.texts().unknownError)\n }\n\n return observableOf(new NbAuthResult(false, res, this.getOption('redirect.failure'), errors, []))\n }\n\n /** The URL of `authorize`, with the sign-in's state and PKCE challenge. */\n protected buildRedirectUrl(\n sign: { state?: string, code_challenge?: string, code_challenge_method?: string } = {}\n ) {\n const params = {\n response_type: this.getOption('authorize.responseType'),\n client_id: this.getOption('clientId'),\n redirect_uri: this.getOption('authorize.redirectUri'),\n scope: this.getOption('authorize.scope'),\n state: sign.state ?? this.getOption('authorize.state'),\n code_challenge: sign.code_challenge,\n code_challenge_method: sign.code_challenge_method,\n\n ...this.getOption('authorize.params')\n }\n\n const endpoint = this.getActionEndpoint('authorize')\n const query = this.urlEncodeParameters(this.cleanParams(params))\n\n return `${endpoint}?${query}`\n }\n\n protected parseHashAsQueryParams(hash: string | null): { [key: string]: string } {\n return hash\n ? hash.split('&').reduce<{ [key: string]: string }>((acc, part) => {\n const item = part.split('=')\n acc[item[0]] = decodeURIComponent(item[1])\n return acc\n }, {})\n : {}\n }\n\n protected urlEncodeParameters(params: Record<string, unknown>): string {\n return Object.keys(params)\n .map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(String(params[k]))}`)\n .join('&')\n }\n\n protected createRefreshedToken(\n res: unknown,\n existingToken: NbAuthRefreshableToken,\n requireValidToken?: boolean\n ): NbAuthToken {\n const refreshedToken = this.createToken(res, requireValidToken)\n if (isRefreshableToken(refreshedToken) && !refreshedToken.getRefreshToken() && existingToken.getRefreshToken()) {\n refreshedToken.setRefreshToken(existingToken.getRefreshToken())\n }\n return refreshedToken\n }\n\n register(_data?: unknown): Observable<NbAuthResult> {\n throw new Error('`register` is not supported by `NbOAuth2AuthStrategy`, use `authenticate`.')\n }\n\n requestPassword(_data?: unknown): Observable<NbAuthResult> {\n throw new Error('`requestPassword` is not supported by `NbOAuth2AuthStrategy`, use `authenticate`.')\n }\n\n resetPassword(_data?: unknown): Observable<NbAuthResult> {\n throw new Error('`resetPassword` is not supported by `NbOAuth2AuthStrategy`, use `authenticate`.')\n }\n\n logout(): Observable<NbAuthResult> {\n return observableOf(new NbAuthResult(true))\n }\n}\n","import { HttpErrorResponse, HttpResponse } from '@angular/common/http'\nimport { NbAuthSimpleToken } from '../../services/token/token'\nimport { NbAuthStrategyOptions, NbStrategyToken } from '../auth-strategy-options'\nimport { getDeepFromObject, nbAuthMessages } from '../../helpers'\n\n/** The modules (actions) of the password strategy, as its options name them. */\nexport type NbPasswordStrategyModuleName = 'login' | 'register' | 'requestPass' | 'resetPass' | 'logout' | 'refreshToken'\n\nexport interface NbPasswordStrategyModule {\n alwaysFail?: boolean\n endpoint?: string\n method?: string\n /** Where to go after the action; `null` turns a default redirect off, while a missing one keeps the default. */\n redirect?: {\n success?: string | null\n failure?: string | null\n }\n requireValidToken?: boolean\n defaultErrors?: string[]\n defaultMessages?: string[]\n}\n\nexport interface NbPasswordStrategyReset extends NbPasswordStrategyModule {\n resetPasswordTokenKey?: string\n}\n\nexport interface NbPasswordStrategyToken extends NbStrategyToken {\n key?: string\n /** Reads the token value from a successful response of the given module (action). */\n getter?(module: string, res: HttpResponse<unknown>, options: NbPasswordAuthStrategyOptions): unknown\n}\n\nexport interface NbPasswordStrategyMessage {\n key?: string\n /**\n * Reads the messages from a successful response, or the errors from a failed one, of the given module (action). The\n * response is the strategy's own: an `HttpResponse` or `HttpErrorResponse` in the password strategy.\n */\n getter?(module: string, res: unknown, options: NbAuthStrategyOptions): string[]\n}\n\n/**\n * The options a getter is called with: the defaults merged with the configured ones, so the getter's key is set.\n */\ntype NbPasswordStrategyOptionsWithKey<K extends 'token' | 'errors' | 'messages'> = NbPasswordAuthStrategyOptions\n & Record<K, { key: string }>\n\nexport class NbPasswordAuthStrategyOptions extends NbAuthStrategyOptions {\n baseEndpoint?: string = '/api/auth/'\n login?: boolean | NbPasswordStrategyModule = {\n alwaysFail: false,\n endpoint: 'login',\n method: 'post',\n requireValidToken: true,\n redirect: {\n success: '/',\n failure: null\n },\n defaultErrors: ['Login/Email combination is not correct, please try again.'],\n defaultMessages: ['You have been successfully logged in.']\n }\n register?: boolean | NbPasswordStrategyModule = {\n alwaysFail: false,\n endpoint: 'register',\n method: 'post',\n requireValidToken: true,\n redirect: {\n success: '/',\n failure: null\n },\n defaultErrors: ['Something went wrong, please try again.'],\n defaultMessages: ['You have been successfully registered.']\n }\n requestPass?: boolean | NbPasswordStrategyModule = {\n endpoint: 'request-pass',\n method: 'post',\n redirect: {\n success: '/',\n failure: null\n },\n defaultErrors: ['Something went wrong, please try again.'],\n defaultMessages: ['Reset password instructions have been sent to your email.']\n }\n resetPass?: boolean | NbPasswordStrategyReset = {\n endpoint: 'reset-pass',\n method: 'put',\n redirect: {\n success: '/',\n failure: null\n },\n resetPasswordTokenKey: 'reset_password_token',\n defaultErrors: ['Something went wrong, please try again.'],\n defaultMessages: ['Your password has been successfully changed.']\n }\n logout?: boolean | NbPasswordStrategyReset = {\n alwaysFail: false,\n endpoint: 'logout',\n method: 'delete',\n redirect: {\n success: '/',\n failure: null\n },\n defaultErrors: ['Something went wrong, please try again.'],\n defaultMessages: ['You have been successfully logged out.']\n }\n refreshToken?: boolean | NbPasswordStrategyModule = {\n endpoint: 'refresh-token',\n method: 'post',\n requireValidToken: true,\n redirect: {\n success: null,\n failure: null\n },\n defaultErrors: ['Something went wrong, please try again.'],\n defaultMessages: ['Your token has been successfully refreshed.']\n }\n override token?: NbPasswordStrategyToken = {\n class: NbAuthSimpleToken,\n key: 'data.token',\n getter: (module: string, res: HttpResponse<unknown>, options: NbPasswordStrategyOptionsWithKey<'token'>) =>\n getDeepFromObject(res.body, options.token.key)\n }\n errors?: NbPasswordStrategyMessage = {\n key: 'data.errors',\n getter: (module: string, res: HttpErrorResponse, options: NbPasswordStrategyOptionsWithKey<'errors'>) =>\n nbAuthMessages(\n getDeepFromObject(res.error, options.errors.key, getDeepFromObject(options, `${module}.defaultErrors`))\n )\n }\n messages?: NbPasswordStrategyMessage = {\n key: 'data.messages',\n getter: (module: string, res: HttpResponse<unknown>, options: NbPasswordStrategyOptionsWithKey<'messages'>) =>\n nbAuthMessages(\n getDeepFromObject(res.body, options.messages.key, getDeepFromObject(options, `${module}.defaultMessages`))\n )\n }\n validation?: {\n password?: {\n required?: boolean\n minLength?: number\n maxLength?: number\n regexp?: string\n }\n email?: {\n required?: boolean\n regexp?: string\n }\n fullName?: {\n required?: boolean\n minLength?: number\n maxLength?: number\n regexp?: string\n }\n }\n}\n\nexport const passwordStrategyOptions: NbPasswordAuthStrategyOptions = new NbPasswordAuthStrategyOptions()\n","import { inject, Service } from '@angular/core'\nimport { HttpClient, HttpErrorResponse, HttpResponse } from '@angular/common/http'\nimport { ActivatedRoute } from '@angular/router'\nimport { Observable, of as observableOf } from 'rxjs'\nimport { switchMap, map, catchError } from 'rxjs/operators'\n\nimport { NbAuthResult } from '../../services/auth-result'\nimport { NbAuthStrategy } from '../auth-strategy'\nimport { NbAuthStrategyClass } from '../../auth.options'\nimport { NbAuthIllegalTokenError } from '../../services/token/token'\nimport {\n NbPasswordAuthStrategyOptions,\n NbPasswordStrategyModuleName,\n passwordStrategyOptions\n} from './password-strategy-options'\n\n/**\n * Signs in, up and out, and requests and resets the password, against an email and password backend. Each action\n * (`login`, `register`, `requestPass`, `resetPass`, `logout`, `refreshToken`) sends its data to its `endpoint` after\n * `baseEndpoint`, reads the token, messages and errors from the response with the `token`, `messages` and `errors`\n * getters, and redirects as its `redirect` says; `resetPass` adds the reset token from the page's query under\n * `resetPasswordTokenKey`. With `requireValidToken`, a response without a valid token fails the action.\n *\n * Strategy settings; `setup` takes the ones to change, over these defaults. `defaultErrors` and `defaultMessages` are\n * the `authStrategy` texts (`provideNbTexts`), unless the given options set them:\n *\n * ```ts\n *export class NbPasswordAuthStrategyOptions extends NbAuthStrategyOptions {\n * name = '';\n * baseEndpoint?: string = '/api/auth/';\n * login?: boolean | NbPasswordStrategyModule = {\n * alwaysFail: false,\n * endpoint: 'login',\n * method: 'post',\n * requireValidToken: true,\n * redirect: {\n * success: '/',\n * failure: null,\n * },\n * defaultErrors: ['Login/Email combination is not correct, please try again.'],\n * defaultMessages: ['You have been successfully logged in.'],\n * };\n * register?: boolean | NbPasswordStrategyModule = {\n * alwaysFail: false,\n * endpoint: 'register',\n * method: 'post',\n * requireValidToken: true,\n * redirect: {\n * success: '/',\n * failure: null,\n * },\n * defaultErrors: ['Something went wrong, please try again.'],\n * defaultMessages: ['You have been successfully registered.'],\n * };\n * requestPass?: boolean | NbPasswordStrategyModule = {\n * endpoint: 'request-pass',\n * method: 'post',\n * redirect: {\n * success: '/',\n * failure: null,\n * },\n * defaultErrors: ['Something went wrong, please try again.'],\n * defaultMessages: ['Reset password instructions have been sent to your email.'],\n * };\n * resetPass?: boolean | NbPasswordStrategyReset = {\n * endpoint: 'reset-pass',\n * method: 'put',\n * redirect: {\n * success: '/',\n * failure: null,\n * },\n * resetPasswordTokenKey: 'reset_password_token',\n * defaultErrors: ['Something went wrong, please try again.'],\n * defaultMessages: ['Your password has been successfully changed.'],\n * };\n * logout?: boolean | NbPasswordStrategyReset = {\n * alwaysFail: false,\n * endpoint: 'logout',\n * method: 'delete',\n * redirect: {\n * success: '/',\n * failure: null,\n * },\n * defaultErrors: ['Something went wrong, please try again.'],\n * defaultMessages: ['You have been successfully logged out.'],\n * };\n * refreshToken?: boolean | NbPasswordStrategyModule = {\n * endpoint: 'refresh-token',\n * method: 'post',\n * requireValidToken: true,\n * redirect: {\n * success: null,\n * failure: null,\n * },\n * defaultErrors: ['Something went wrong, please try again.'],\n * defaultMessages: ['Your token has been successfully refreshed.'],\n * };\n * token?: NbPasswordStrategyToken = {\n * class: NbAuthSimpleToken,\n * key: 'data.token',\n * getter: (module, res, options) => getDeepFromObject(res.body, options.token.key),\n * };\n * errors?: NbPasswordStrategyMessage = {\n * key: 'data.errors',\n * getter: (module, res, options) =>\n * nbAuthMessages(getDeepFromObject(res.error, options.errors.key, options[module].defaultErrors)),\n * };\n * messages?: NbPasswordStrategyMessage = {\n * key: 'data.messages',\n * getter: (module, res, options) =>\n * nbAuthMessages(getDeepFromObject(res.body, options.messages.key, options[module].defaultMessages)),\n * };\n * validation?: {\n * password?: {\n * required?: boolean;\n * minLength?: number;\n * maxLength?: number;\n * regexp?: string;\n * };\n * email?: {\n * required?: boolean;\n * regexp?: string;\n * };\n * fullName?: {\n * required?: boolean;\n * minLength?: number;\n * maxLength?: number;\n * regexp?: string;\n * };\n * };\n *}\n * ```\n */\n@Service({ autoProvided: false })\nexport class NbPasswordAuthStrategy extends NbAuthStrategy<NbPasswordAuthStrategyOptions> {\n protected readonly http = inject(HttpClient)\n private readonly route = inject(ActivatedRoute)\n\n protected override defaultOptions: NbPasswordAuthStrategyOptions = passwordStrategyOptions\n\n static setup(options: NbPasswordAuthStrategyOptions): [NbAuthStrategyClass, NbPasswordAuthStrategyOptions] {\n return [NbPasswordAuthStrategy, options]\n }\n\n authenticate(data?: unknown): Observable<NbAuthResult> {\n const module = 'login'\n const method = this.getOption(`${module}.method`) ?? 'post'\n const url = this.getActionEndpoint(module)\n const requireValidToken = this.getOption(`${module}.requireValidToken`)\n return this.http.request(method, url, { body: data, observe: 'response', headers: this.getHeaders() }).pipe(\n map((res) => {\n if (this.getOption(`${module}.alwaysFail`)) {\n throw this.createFailResponse(data)\n }\n return res\n }),\n map((res) => new NbAuthResult(\n true,\n res,\n this.getOption(`${module}.redirect.success`),\n [],\n this.readMessages(module, res),\n this.createToken(this.readToken(module, res), requireValidToken)\n )),\n catchError((res) => this.handleResponseError(res, module))\n )\n }\n\n register(data?: unknown): Observable<NbAuthResult> {\n const module = 'register'\n const method = this.getOption(`${module}.method`) ?? 'post'\n const url = this.getActionEndpoint(module)\n const requireValidToken = this.getOption(`${module}.requireValidToken`)\n return this.http.request(method, url, { body: data, observe: 'response', headers: this.getHeaders() }).pipe(\n map((res) => {\n if (this.getOption(`${module}.alwaysFail`)) {\n throw this.createFailResponse(data)\n }\n\n return res\n }),\n map((res) => new NbAuthResult(\n true,\n res,\n this.getOption(`${module}.redirect.success`),\n [],\n this.readMessages(module, res),\n this.createToken(this.readToken('login', res), requireValidToken)\n )),\n catchError((res) => this.handleResponseError(res, module))\n )\n }\n\n requestPassword(data?: unknown): Observable<NbAuthResult> {\n const module = 'requestPass'\n const method = this.getOption(`${module}.method`) ?? 'post'\n const url = this.getActionEndpoint(module)\n return this.http.request(method, url, { body: data, observe: 'response', headers: this.getHeaders() }).pipe(\n map((res) => {\n if (this.getOption(`${module}.alwaysFail`)) {\n throw this.createFailResponse()\n }\n\n return res\n }),\n map((res) => new NbAuthResult(\n true,\n res,\n this.getOption(`${module}.redirect.success`),\n [],\n this.readMessages(module, res)\n )),\n catchError((res) => this.handleResponseError(res, module))\n )\n }\n\n /** Sends the data with the reset password token of the page's query, under the options' `resetPasswordTokenKey`. */\n resetPassword(data: Record<string, unknown> = {}): Observable<NbAuthResult> {\n const module = 'resetPass'\n const method = this.getOption(`${module}.method`) ?? 'put'\n const url = this.getActionEndpoint(module)\n const tokenKey = this.getOption(`${module}.resetPasswordTokenKey`) ?? ''\n data[tokenKey] = this.route.snapshot.queryParams[tokenKey]\n return this.http.request(method, url, { body: data, observe: 'response', headers: this.getHeaders() }).pipe(\n map((res) => {\n if (this.getOption(`${module}.alwaysFail`)) {\n throw this.createFailResponse()\n }\n\n return res\n }),\n map((res) => new NbAuthResult(\n true,\n res,\n this.getOption(`${module}.redirect.success`),\n [],\n this.readMessages(module, res)\n )),\n catchError((res) => this.handleResponseError(res, module))\n )\n }\n\n logout(): Observable<NbAuthResult> {\n const module = 'logout'\n const method = this.getOption(`${module}.method`) ?? 'delete'\n const url = this.getActionEndpoint(module)\n\n return observableOf({}).pipe(\n switchMap((res: object) => {\n if (!url) {\n return observableOf(res)\n }\n return this.http.request(method, url, { observe: 'response', headers: this.getHeaders() })\n }),\n map((res) => {\n if (this.getOption(`${module}.alwaysFail`)) {\n throw this.createFailResponse()\n }\n\n return res\n }),\n map((res) => new NbAuthResult(\n true,\n res,\n this.getOption(`${module}.redirect.success`),\n [],\n this.readMessages(module, res)\n )),\n catchError((res) => this.handleResponseError(res, module))\n )\n }\n\n refreshToken(data?: unknown): Observable<NbAuthResult> {\n const module = 'refreshToken'\n const method = this.getOption(`${module}.method`) ?? 'post'\n const url = this.getActionEndpoint(module)\n const requireValidToken = this.getOption(`${module}.requireValidToken`)\n\n return this.http.request(method, url, { body: data, observe: 'response', headers: this.getHeaders() }).pipe(\n map((res) => {\n if (this.getOption(`${module}.alwaysFail`)) {\n throw this.createFailResponse(data)\n }\n\n return res\n }),\n map((res) => new NbAuthResult(\n true,\n res,\n this.getOption(`${module}.redirect.success`),\n [],\n this.readMessages(module, res),\n this.createToken(this.readToken(module, res), requireValidToken)\n )),\n catchError((res) => this.handleResponseError(res, module))\n )\n }\n\n /** The messages of a module's response, as the options' messages getter reads them. */\n protected readMessages(module: NbPasswordStrategyModuleName, res: unknown): string[] | undefined {\n const options = this.options\n const getter = options?.messages?.getter\n return options && getter ? getter(module, res, options) : undefined\n }\n\n /** The token value of a module's response, as the options' token getter reads it. */\n protected readToken(module: NbPasswordStrategyModuleName, res: HttpResponse<unknown>): unknown {\n const options = this.options\n const getter = options?.token?.getter\n return options && getter ? getter(module, res, options) : undefined\n }\n\n /** A failed module's result, with the errors of the options' errors getter for an error response. */\n protected handleResponseError(res: unknown, module: NbPasswordStrategyModuleName): Observable<NbAuthResult> {\n let errors = new Array<string>()\n const options = this.options\n const getter = options?.errors?.getter\n if (res instanceof HttpErrorResponse) {\n errors = options && getter ? getter(module, res, options) : []\n } else if (res instanceof NbAuthIllegalTokenError) {\n errors.push(res.message)\n } else {\n errors.push(this.texts().unknownError)\n }\n return observableOf(new NbAuthResult(false, res, this.getOption(`${module}.redirect.failure`), errors))\n }\n}\n","import { Component } from '@angular/core'\n\n@Component({\n selector: 'nb-auth-block',\n styleUrls: ['./auth-block.component.scss'],\n template: ' <ng-content /> '\n})\nexport class NbAuthBlockComponent {}\n","import { Component, ChangeDetectionStrategy, DestroyRef, inject } from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\nimport { Location } from '@angular/common'\nimport { Subscription } from 'rxjs'\n\nimport {\n NbLayoutComponent,\n NbLayoutColumnComponent,\n NbCardComponent,\n NbCardHeaderComponent,\n NbCardBodyComponent,\n NbIconComponent\n} from '@liquid-js/lyr-core'\nimport { RouterOutlet } from '@angular/router'\nimport { NbAuthService } from '../services/auth.service'\nimport { injectNbAuthTexts } from '../texts'\nimport { NbAuthBlockComponent } from './auth-block/auth-block.component'\n\n@Component({\n selector: 'nb-auth',\n styleUrls: ['./auth.component.scss'],\n templateUrl: './auth.component.html',\n // Routed auth pages may not use signals, so the outlet is checked on every change detection.\n changeDetection: ChangeDetectionStrategy.Eager,\n imports: [\n NbLayoutComponent,\n NbLayoutColumnComponent,\n NbCardComponent,\n NbCardHeaderComponent,\n NbCardBodyComponent,\n NbIconComponent,\n NbAuthBlockComponent,\n RouterOutlet\n ]\n})\nexport class NbAuthComponent {\n protected readonly texts = injectNbAuthTexts()\n\n protected readonly destroyRef = inject(DestroyRef)\n protected readonly auth = inject(NbAuthService)\n protected readonly location = inject(Location)\n\n subscription: Subscription\n\n authenticated = false\n token = ''\n\n // Follows the authentication state, as an example of `onAuthenticationChange()`; the template doesn't read it.\n constructor() {\n const auth = this.auth\n\n this.subscription = auth\n .onAuthenticationChange()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((authenticated: boolean) => {\n this.authenticated = authenticated\n })\n }\n\n back() {\n this.location.back()\n return false\n }\n}\n","<nb-layout>\n <nb-layout-column>\n <nb-card>\n <nb-card-header>\n <nav class=\"navigation\">\n <a href=\"#\"\n (click)=\"back()\"\n class=\"link back-link\"\n [attr.aria-label]=\"texts().back\">\n <nb-icon icon=\"arrow-back-outline\"\n pack=\"essentials\" />\n </a>\n </nav>\n </nb-card-header>\n <nb-card-body>\n <nb-auth-block>\n <router-outlet />\n </nb-auth-block>\n </nb-card-body>\n </nb-card>\n </nb-layout-column>\n</nb-layout>\n","import { ChangeDetectorRef, Component, inject } from '@angular/core'\nimport { Router, RouterLink } from '@angular/router'\nimport {\n NbAlertComponent,\n NbInputDirective,\n NbCheckboxComponent,\n NbButtonComponent,\n NbIconComponent\n} from '@liquid-js/lyr-core'\nimport { FormsModule } from '@angular/forms'\nimport { NB_AUTH_OPTIONS, NbAuthFormMessagesOptions, NbAuthResolvedOptions, NbAuthSocialLink } from '../../auth.options'\nimport { getDeepFromObject, NbPath, NbPathValue } from '../../helpers'\n\nimport { NbAuthService } from '../../services/auth.service'\nimport { NbAuthResult } from '../../services/auth-result'\nimport { NbAuthCredentials } from '../../models/user'\nimport { injectNbAuthTexts } from '../../texts'\n\n@Component({\n selector: 'nb-login',\n templateUrl: './login.component.html',\n imports: [\n NbAlertComponent,\n FormsModule,\n NbInputDirective,\n RouterLink,\n NbCheckboxComponent,\n NbButtonComponent,\n NbIconComponent\n ]\n})\nexport class NbLoginComponent {\n protected readonly texts = injectNbAuthTexts()\n\n protected readonly service = inject(NbAuthService)\n protected readonly options = inject(NB_AUTH_OPTIONS)\n protected readonly cd = inject(ChangeDetectorRef)\n protected readonly router = inject(Router)\n\n redirectDelay: number = this.getConfigValue('forms.login.redirectDelay')\n showMessages: NbAuthFormMessagesOptions = this.getConfigValue('forms.login.showMessages')\n strategy: string = this.getConfigValue('forms.login.strategy')\n\n errors = new Array<string>()\n messages = new Array<string>()\n // Remembered unless the user unticks it.\n user: NbAuthCredentials = { rememberMe: true }\n submitted = false\n socialLinks: NbAuthSocialLink[] = this.getConfigValue('forms.login.socialLinks')\n rememberMe: boolean = this.getConfigValue('forms.login.rememberMe')\n\n login() {\n this.errors = []\n this.messages = []\n this.submitted = true\n\n this.service.authenticate(this.strategy, this.user).subscribe((result: NbAuthResult) => {\n this.submitted = false\n\n if (result.isSuccess()) {\n this.messages = result.getMessages()\n } else {\n this.errors = result.getErrors()\n }\n\n const redirect = result.getRedirect()\n if (redirect) {\n setTimeout(() => this.router.navigateByUrl(redirect), this.redirectDelay)\n }\n this.cd.detectChanges()\n })\n }\n\n getConfigValue<P extends NbPath<NbAuthResolvedOptions>>(key: P): NbPathValue<NbAuthResolvedOptions, P> {\n return getDeepFromObject(this.options, key)\n }\n}\n","<h1 id=\"title\"\n class=\"title\">{{ texts().loginTitle }}</h1>\n<p class=\"sub-title\">{{ texts().loginSubtitle }}</p>\n\n@if (showMessages.error && errors?.length && !submitted) {\n<nb-alert status=\"danger\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().errorTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (error of errors; track $index) {\n <li class=\"alert-message\">{{ error }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n@if (showMessages.success && messages?.length && !submitted) {\n<nb-alert status=\"success\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().successTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (message of messages; track $index) {\n <li class=\"alert-message\">{{ message }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n<form (ngSubmit)=\"login()\"\n #form=\"ngForm\"\n aria-labelledby=\"title\">\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-email\">{{ texts().emailLabel }}</label>\n <input nbInput\n fullWidth\n [(ngModel)]=\"user.email\"\n #email=\"ngModel\"\n name=\"email\"\n id=\"input-email\"\n pattern=\".+@.+\\..+\"\n [placeholder]=\"texts().emailPlaceholder\"\n fieldSize=\"large\"\n autofocus\n [status]=\"email.dirty ? (email.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.email.required')\"\n [attr.aria-invalid]=\"email.invalid && email.touched ? true : null\">\n @if (email.invalid && email.touched) {\n @if (email.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().emailRequired }}\n </p>\n }\n @if (email.errors?.['pattern']) {\n <p class=\"caption status-danger\">\n {{ texts().emailInvalid }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <span class=\"label-with-link\">\n <label class=\"label\"\n for=\"input-password\">{{ texts().passwordLabel }}</label>\n <a class=\"forgot-password caption-2\"\n routerLink=\"../request-password\">{{ texts().forgotPassword }}</a>\n </span>\n <input nbInput\n fullWidth\n [(ngModel)]=\"user.password\"\n #password=\"ngModel\"\n name=\"password\"\n type=\"password\"\n id=\"input-password\"\n [placeholder]=\"texts().passwordPlaceholder\"\n fieldSize=\"large\"\n [status]=\"password.dirty ? (password.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [minlength]=\"getConfigValue('forms.validation.password.minLength')\"\n [maxlength]=\"getConfigValue('forms.validation.password.maxLength')\"\n [attr.aria-invalid]=\"password.invalid && password.touched ? true : null\">\n @if (password.invalid && password.touched ) {\n @if (password.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordRequired }}\n </p>\n }\n @if (password.errors?.['minlength'] || password.errors?.['maxlength']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordLength(getConfigValue('forms.validation.password.minLength'), getConfigValue('forms.validation.password.maxLength')) }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group accept-group\">\n @if (rememberMe) {\n <nb-checkbox name=\"rememberMe\"\n [(ngModel)]=\"user.rememberMe\">{{ texts().rememberMe }}</nb-checkbox>\n }\n </div>\n\n <button nbButton\n fullWidth\n status=\"primary\"\n size=\"large\"\n [disabled]=\"submitted || !form.valid\"\n [class.btn-pulse]=\"submitted\">\n {{ texts().loginSubmit }}\n </button>\n</form>\n\n@if (socialLinks && socialLinks.length > 0) {\n<section class=\"links\"\n [attr.aria-label]=\"texts().socialLabel\">\n {{ texts().socialPrompt }}\n <div class=\"socials\">\n @for (socialLink of socialLinks; track socialLink) {\n @if (socialLink.link) {\n <a [routerLink]=\"socialLink.link\"\n [attr.target]=\"socialLink.target\"\n [attr.class]=\"socialLink.icon\"\n [attr.aria-label]=\"socialLink.icon ? socialLink.title : null\"\n [class.with-icon]=\"socialLink.icon\">\n @if (socialLink.icon) {\n <nb-icon [icon]=\"socialLink.icon\" />\n } @else {{{ socialLink.title }}}\n </a>\n }\n @if (socialLink.url) {\n <a [attr.href]=\"socialLink.url\"\n [attr.target]=\"socialLink.target\"\n [attr.class]=\"socialLink.icon\"\n [attr.aria-label]=\"socialLink.icon ? socialLink.title : null\"\n [class.with-icon]=\"socialLink.icon\">\n @if (socialLink.icon) {\n <nb-icon [icon]=\"socialLink.icon\" />\n } @else {{{ socialLink.title }}}\n </a>\n }\n }\n </div>\n</section>\n}\n\n<section class=\"another-action\"\n [attr.aria-label]=\"texts().registerLink\">\n {{ texts().noAccount }} <a class=\"text-link\"\n routerLink=\"../register\">{{ texts().registerLink }}</a>\n</section>\n","import { ChangeDetectorRef, Component, inject } from '@angular/core'\nimport { Router, RouterLink } from '@angular/router'\nimport {\n NbAlertComponent,\n NbInputDirective,\n NbCheckboxComponent,\n NbButtonComponent,\n NbIconComponent\n} from '@liquid-js/lyr-core'\nimport { FormsModule } from '@angular/forms'\nimport { NB_AUTH_OPTIONS, NbAuthFormMessagesOptions, NbAuthResolvedOptions, NbAuthSocialLink } from '../../auth.options'\nimport { getDeepFromObject, NbPath, NbPathValue } from '../../helpers'\n\nimport { NbAuthService } from '../../services/auth.service'\nimport { NbAuthResult } from '../../services/auth-result'\nimport { NbAuthCredentials } from '../../models/user'\nimport { injectNbAuthTexts } from '../../texts'\n\n@Component({\n selector: 'nb-register',\n styleUrls: ['./register.component.scss'],\n templateUrl: './register.component.html',\n imports: [\n NbAlertComponent,\n FormsModule,\n NbInputDirective,\n NbCheckboxComponent,\n NbButtonComponent,\n RouterLink,\n NbIconComponent\n ]\n})\nexport class NbRegisterComponent {\n protected readonly texts = injectNbAuthTexts()\n\n protected readonly service = inject(NbAuthService)\n protected readonly options = inject(NB_AUTH_OPTIONS)\n protected readonly cd = inject(ChangeDetectorRef)\n protected readonly router = inject(Router)\n\n redirectDelay: number = this.getConfigValue('forms.register.redirectDelay')\n showMessages: NbAuthFormMessagesOptions = this.getConfigValue('forms.register.showMessages')\n strategy: string = this.getConfigValue('forms.register.strategy')\n\n submitted = false\n errors = new Array<string>()\n messages = new Array<string>()\n user: NbAuthCredentials = {}\n socialLinks: NbAuthSocialLink[] = this.getConfigValue('forms.login.socialLinks')\n\n register() {\n this.errors = this.messages = []\n this.submitted = true\n\n this.service.register(this.strategy, this.user).subscribe((result: NbAuthResult) => {\n this.submitted = false\n if (result.isSuccess()) {\n this.messages = result.getMessages()\n } else {\n this.errors = result.getErrors()\n }\n\n const redirect = result.getRedirect()\n if (redirect) {\n setTimeout(() => this.router.navigateByUrl(redirect), this.redirectDelay)\n }\n this.cd.detectChanges()\n })\n }\n\n getConfigValue<P extends NbPath<NbAuthResolvedOptions>>(key: P): NbPathValue<NbAuthResolvedOptions, P> {\n return getDeepFromObject(this.options, key)\n }\n}\n","<h1 id=\"title\"\n class=\"title\">{{ texts().registerTitle }}</h1>\n\n@if (showMessages.error && errors?.length && !submitted) {\n<nb-alert status=\"danger\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().errorTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (error of errors; track $index) {\n <li class=\"alert-message\">{{ error }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n@if (showMessages.success && messages?.length && !submitted) {\n<nb-alert status=\"success\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().successTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (message of messages; track $index) {\n <li class=\"alert-message\">{{ message }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n<form (ngSubmit)=\"register()\"\n #form=\"ngForm\"\n aria-labelledby=\"title\">\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-name\">{{ texts().fullNameLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.fullName\"\n #fullName=\"ngModel\"\n id=\"input-name\"\n name=\"fullName\"\n [placeholder]=\"texts().fullNamePlaceholder\"\n autofocus\n fullWidth\n fieldSize=\"large\"\n [status]=\"fullName.dirty ? (fullName.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.fullName.required')\"\n [minlength]=\"getConfigValue('forms.validation.fullName.minLength')\"\n [maxlength]=\"getConfigValue('forms.validation.fullName.maxLength')\"\n [attr.aria-invalid]=\"fullName.invalid && fullName.touched ? true : null\">\n @if (fullName.invalid && fullName.touched) {\n @if (fullName.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().fullNameRequired }}\n </p>\n }\n @if (fullName.errors?.['minlength'] || fullName.errors?.['maxlength']) {\n <p class=\"caption status-danger\">\n {{ texts().fullNameLength(getConfigValue('forms.validation.fullName.minLength'), getConfigValue('forms.validation.fullName.maxLength')) }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-email\">{{ texts().emailLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.email\"\n #email=\"ngModel\"\n id=\"input-email\"\n name=\"email\"\n pattern=\".+@.+\\..+\"\n [placeholder]=\"texts().emailPlaceholder\"\n fullWidth\n fieldSize=\"large\"\n [status]=\"email.dirty ? (email.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.email.required')\"\n [attr.aria-invalid]=\"email.invalid && email.touched ? true : null\">\n @if (email.invalid && email.touched) {\n @if (email.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().emailRequired }}\n </p>\n }\n @if (email.errors?.['pattern']) {\n <p class=\"caption status-danger\">\n {{ texts().emailInvalid }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-password\">{{ texts().passwordLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.password\"\n #password=\"ngModel\"\n type=\"password\"\n id=\"input-password\"\n name=\"password\"\n [placeholder]=\"texts().passwordPlaceholder\"\n fullWidth\n fieldSize=\"large\"\n [status]=\"password.dirty ? (password.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [minlength]=\"getConfigValue('forms.validation.password.minLength')\"\n [maxlength]=\"getConfigValue('forms.validation.password.maxLength')\"\n [attr.aria-invalid]=\"password.invalid && password.touched ? true : null\">\n @if (password.invalid && password.touched) {\n @if (password.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordRequired }}\n </p>\n }\n @if (password.errors?.['minlength'] || password.errors?.['maxlength']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordLength(getConfigValue('forms.validation.password.minLength'), getConfigValue('forms.validation.password.maxLength')) }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-re-password\">{{ texts().repeatPasswordLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.confirmPassword\"\n #rePass=\"ngModel\"\n type=\"password\"\n id=\"input-re-password\"\n name=\"rePass\"\n [placeholder]=\"texts().confirmPasswordPlaceholder\"\n fullWidth\n fieldSize=\"large\"\n [status]=\"rePass.dirty ? (rePass.invalid || password.value !== rePass.value ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [attr.aria-invalid]=\"(rePass.invalid || password.value !== rePass.value) && rePass.touched ? true : null\">\n @if ((rePass.invalid || password.value !== rePass.value) && rePass.touched) {\n @if (rePass.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().confirmPasswordRequired }}\n </p>\n }\n @if (password.value !== rePass.value && !rePass.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordMismatch }}\n </p>\n }\n }\n </div>\n\n @if (getConfigValue('forms.register.terms')) {\n <div class=\"form-control-group accept-group\">\n <nb-checkbox name=\"terms\"\n [(ngModel)]=\"user.terms\"\n [required]=\"getConfigValue('forms.register.terms')\">\n {{ texts().agreeTo }} <a href=\"#\"\n target=\"_blank\"><strong>{{ texts().terms }}</strong></a>\n </nb-checkbox>\n </div>\n }\n\n <button nbButton\n fullWidth\n status=\"primary\"\n size=\"large\"\n [disabled]=\"submitted || !form.valid || user.password !== user.confirmPassword\"\n [class.btn-pulse]=\"submitted\">\n {{ texts().registerSubmit }}\n </button>\n</form>\n\n@if (socialLinks && socialLinks.length > 0) {\n<section class=\"links\"\n [attr.aria-label]=\"texts().socialLabel\">\n {{ texts().socialPrompt }}\n <div class=\"socials\">\n @for (socialLink of socialLinks; track socialLink) {\n @if (socialLink.link) {\n <a [routerLink]=\"socialLink.link\"\n [attr.target]=\"socialLink.target\"\n [attr.class]=\"socialLink.icon\"\n [attr.aria-label]=\"socialLink.icon ? socialLink.title : null\"\n [class.with-icon]=\"socialLink.icon\">\n @if (socialLink.icon) {\n <nb-icon [icon]=\"socialLink.icon\" />\n } @else {{{ socialLink.title }}}\n </a>\n }\n @if (socialLink.url) {\n <a [attr.href]=\"socialLink.url\"\n [attr.target]=\"socialLink.target\"\n [attr.class]=\"socialLink.icon\"\n [attr.aria-label]=\"socialLink.icon ? socialLink.title : null\"\n [class.with-icon]=\"socialLink.icon\">\n @if (socialLink.icon) {\n <nb-icon [icon]=\"socialLink.icon\" />\n } @else {{{ socialLink.title }}}\n </a>\n }\n }\n </div>\n</section>\n}\n\n<section class=\"another-action\"\n [attr.aria-label]=\"texts().signInLabel\">\n {{ texts().haveAccount }} <a class=\"text-link\"\n routerLink=\"../login\">{{ texts().loginLink }}</a>\n</section>\n","import { Component, OnInit, inject } from '@angular/core'\nimport { Router } from '@angular/router'\n\nimport { NB_AUTH_OPTIONS, NbAuthResolvedOptions } from '../../auth.options'\nimport { getDeepFromObject, NbPath, NbPathValue } from '../../helpers'\nimport { NbAuthService } from '../../services/auth.service'\nimport { NbAuthResult } from '../../services/auth-result'\nimport { injectNbAuthTexts } from '../../texts'\n\n@Component({\n selector: 'nb-logout',\n templateUrl: './logout.component.html'\n})\nexport class NbLogoutComponent implements OnInit {\n protected readonly texts = injectNbAuthTexts()\n\n protected readonly service = inject(NbAuthService)\n protected readonly options = inject(NB_AUTH_OPTIONS)\n protected readonly router = inject(Router)\n\n redirectDelay: number = this.getConfigValue('forms.logout.redirectDelay')\n strategy: string = this.getConfigValue('forms.logout.strategy')\n\n ngOnInit() {\n this.logout(this.strategy)\n }\n\n logout(strategy: string) {\n this.service.logout(strategy).subscribe((result: NbAuthResult) => {\n const redirect = result.getRedirect()\n if (redirect) {\n setTimeout(() => this.router.navigateByUrl(redirect), this.redirectDelay)\n }\n })\n }\n\n getConfigValue<P extends NbPath<NbAuthResolvedOptions>>(key: P): NbPathValue<NbAuthResolvedOptions, P> {\n return getDeepFromObject(this.options, key)\n }\n}\n","<div>{{ texts().loggingOut }}</div>\n","import { ChangeDetectorRef, Component, inject } from '@angular/core'\nimport { Router, RouterLink } from '@angular/router'\nimport {\n NbAlertComponent,\n NbInputDirective,\n NbButtonComponent\n} from '@liquid-js/lyr-core'\nimport { FormsModule } from '@angular/forms'\nimport { NB_AUTH_OPTIONS, NbAuthFormMessagesOptions, NbAuthResolvedOptions } from '../../auth.options'\nimport { getDeepFromObject, NbPath, NbPathValue } from '../../helpers'\n\nimport { NbAuthService } from '../../services/auth.service'\nimport { NbAuthResult } from '../../services/auth-result'\nimport { NbAuthCredentials } from '../../models/user'\nimport { injectNbAuthTexts } from '../../texts'\n\n@Component({\n selector: 'nb-request-password-page',\n templateUrl: './request-password.component.html',\n imports: [\n NbAlertComponent,\n FormsModule,\n NbInputDirective,\n NbButtonComponent,\n RouterLink\n ]\n})\nexport class NbRequestPasswordComponent {\n protected readonly texts = injectNbAuthTexts()\n\n protected readonly service = inject(NbAuthService)\n protected readonly options = inject(NB_AUTH_OPTIONS)\n protected readonly cd = inject(ChangeDetectorRef)\n protected readonly router = inject(Router)\n\n redirectDelay: number = this.getConfigValue('forms.requestPassword.redirectDelay')\n showMessages: NbAuthFormMessagesOptions = this.getConfigValue('forms.requestPassword.showMessages')\n strategy: string = this.getConfigValue('forms.requestPassword.strategy')\n\n submitted = false\n errors = new Array<string>()\n messages = new Array<string>()\n user: NbAuthCredentials = {}\n\n requestPass() {\n this.errors = this.messages = []\n this.submitted = true\n\n this.service.requestPassword(this.strategy, this.user).subscribe((result: NbAuthResult) => {\n this.submitted = false\n if (result.isSuccess()) {\n this.messages = result.getMessages()\n } else {\n this.errors = result.getErrors()\n }\n\n const redirect = result.getRedirect()\n if (redirect) {\n setTimeout(() => this.router.navigateByUrl(redirect), this.redirectDelay)\n }\n this.cd.detectChanges()\n })\n }\n\n getConfigValue<P extends NbPath<NbAuthResolvedOptions>>(key: P): NbPathValue<NbAuthResolvedOptions, P> {\n return getDeepFromObject(this.options, key)\n }\n}\n","<h1 id=\"title\"\n class=\"title\">{{ texts().requestPasswordTitle }}</h1>\n<p class=\"sub-title\">{{ texts().requestPasswordSubtitle }}</p>\n\n@if (showMessages.error && errors?.length && !submitted) {\n<nb-alert status=\"danger\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().errorTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (error of errors; track $index) {\n <li class=\"alert-message\">{{ error }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n@if (showMessages.success && messages?.length && !submitted) {\n<nb-alert status=\"success\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().successTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (message of messages; track $index) {\n <li class=\"alert-message\">{{ message }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n<form (ngSubmit)=\"requestPass()\"\n #requestPassForm=\"ngForm\"\n aria-labelledby=\"title\">\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-email\">{{ texts().requestPasswordEmailLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.email\"\n #email=\"ngModel\"\n id=\"input-email\"\n name=\"email\"\n pattern=\".+@.+\\..+\"\n [placeholder]=\"texts().emailPlaceholder\"\n autofocus\n fullWidth\n fieldSize=\"large\"\n [status]=\"email.dirty ? (email.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.email.required')\"\n [attr.aria-invalid]=\"email.invalid && email.touched ? true : null\">\n @if (email.invalid && email.touched) {\n @if (email.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().emailRequired }}\n </p>\n }\n @if (email.errors?.['pattern']) {\n <p class=\"caption status-danger\">\n {{ texts().emailInvalid }}\n </p>\n }\n }\n </div>\n\n <button nbButton\n fullWidth\n status=\"primary\"\n size=\"large\"\n [disabled]=\"submitted || !requestPassForm.valid\"\n [class.btn-pulse]=\"submitted\">\n {{ texts().requestPasswordSubmit }}\n </button>\n</form>\n\n<section class=\"sign-in-or-up\"\n [attr.aria-label]=\"texts().signInOrUpLabel\">\n <p><a class=\"text-link\"\n routerLink=\"../login\">{{ texts().backToLogin }}</a></p>\n <p><a routerLink=\"../register\"\n class=\"text-link\">{{ texts().registerLink }}</a></p>\n</section>\n","import { ChangeDetectorRef, Component, inject } from '@angular/core'\nimport { Router, RouterLink } from '@angular/router'\nimport {\n NbAlertComponent,\n NbInputDirective,\n NbButtonComponent\n} from '@liquid-js/lyr-core'\nimport { FormsModule } from '@angular/forms'\nimport { NB_AUTH_OPTIONS, NbAuthFormMessagesOptions, NbAuthResolvedOptions } from '../../auth.options'\nimport { getDeepFromObject, NbPath, NbPathValue } from '../../helpers'\n\nimport { NbAuthService } from '../../services/auth.service'\nimport { NbAuthResult } from '../../services/auth-result'\nimport { NbAuthCredentials } from '../../models/user'\nimport { injectNbAuthTexts } from '../../texts'\n\n@Component({\n selector: 'nb-reset-password-page',\n styleUrls: ['./reset-password.component.scss'],\n templateUrl: './reset-password.component.html',\n imports: [\n NbAlertComponent,\n FormsModule,\n NbInputDirective,\n NbButtonComponent,\n RouterLink\n ]\n})\nexport class NbResetPasswordComponent {\n protected readonly texts = injectNbAuthTexts()\n\n protected readonly service = inject(NbAuthService)\n protected readonly options = inject(NB_AUTH_OPTIONS)\n protected readonly cd = inject(ChangeDetectorRef)\n protected readonly router = inject(Router)\n\n redirectDelay: number = this.getConfigValue('forms.resetPassword.redirectDelay')\n showMessages: NbAuthFormMessagesOptions = this.getConfigValue('forms.resetPassword.showMessages')\n strategy: string = this.getConfigValue('forms.resetPassword.strategy')\n\n submitted = false\n errors = new Array<string>()\n messages = new Array<string>()\n user: NbAuthCredentials = {}\n\n resetPass() {\n this.errors = this.messages = []\n this.submitted = true\n\n this.service.resetPassword(this.strategy, this.user).subscribe((result: NbAuthResult) => {\n this.submitted = false\n if (result.isSuccess()) {\n this.messages = result.getMessages()\n } else {\n this.errors = result.getErrors()\n }\n\n const redirect = result.getRedirect()\n if (redirect) {\n setTimeout(() => this.router.navigateByUrl(redirect), this.redirectDelay)\n }\n this.cd.detectChanges()\n })\n }\n\n getConfigValue<P extends NbPath<NbAuthResolvedOptions>>(key: P): NbPathValue<NbAuthResolvedOptions, P> {\n return getDeepFromObject(this.options, key)\n }\n}\n","<h1 id=\"title\"\n class=\"title\">{{ texts().resetPasswordTitle }}</h1>\n<p class=\"sub-title\">{{ texts().resetPasswordSubtitle }}</p>\n\n@if (showMessages.error && errors?.length && !submitted) {\n<nb-alert status=\"danger\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().errorTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (error of errors; track $index) {\n <li class=\"alert-message\">{{ error }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n@if (showMessages.success && messages?.length && !submitted) {\n<nb-alert status=\"success\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().successTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (message of messages; track $index) {\n <li class=\"alert-message\">{{ message }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n<form (ngSubmit)=\"resetPass()\"\n #resetPassForm=\"ngForm\"\n aria-labelledby=\"title\">\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-password\">{{ texts().newPasswordLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.password\"\n #password=\"ngModel\"\n type=\"password\"\n id=\"input-password\"\n name=\"password\"\n class=\"first\"\n [placeholder]=\"texts().newPasswordPlaceholder\"\n autofocus\n fullWidth\n fieldSize=\"large\"\n [status]=\"password.dirty ? (password.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [minlength]=\"getConfigValue('forms.validation.password.minLength')\"\n [maxlength]=\"getConfigValue('forms.validation.password.maxLength')\"\n [attr.aria-invalid]=\"password.invalid && password.touched ? true : null\">\n @if (password.invalid && password.touched) {\n @if (password.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordRequired }}\n </p>\n }\n @if (password.errors?.['minlength'] || password.errors?.['maxlength']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordLength(getConfigValue('forms.validation.password.minLength'), getConfigValue('forms.validation.password.maxLength')) }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-re-password\">{{ texts().confirmPasswordLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.confirmPassword\"\n #rePass=\"ngModel\"\n id=\"input-re-password\"\n name=\"rePass\"\n type=\"password\"\n class=\"last\"\n [placeholder]=\"texts().confirmPasswordPlaceholder\"\n fullWidth\n fieldSize=\"large\"\n [status]=\"rePass.touched\n ? (rePass.invalid || password.value !== rePass.value ? 'danger' : 'success')\n : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [attr.aria-invalid]=\"rePass.invalid && rePass.touched ? true : null\">\n @if (rePass.touched) {\n @if (rePass.invalid && rePass.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().confirmPasswordRequired }}\n </p>\n }\n @if (password.value !== rePass.value && !rePass.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordMismatch }}\n </p>\n }\n }\n </div>\n\n <button nbButton\n status=\"primary\"\n fullWidth\n size=\"large\"\n [disabled]=\"submitted || !resetPassForm.valid\"\n [class.btn-pulse]=\"submitted\">\n {{ texts().resetPasswordSubmit }}\n </button>\n</form>\n\n<section class=\"sign-in-or-up\"\n [attr.aria-label]=\"texts().signInOrUpLabel\">\n <p><a class=\"text-link\"\n routerLink=\"../login\">{{ texts().backToLogin }}</a></p>\n <p><a class=\"text-link\"\n routerLink=\"../register\">{{ texts().registerLink }}</a></p>\n</section>\n","import { Injector, ModuleWithProviders, NgModule, EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'\nimport { RouterModule } from '@angular/router'\nimport { FormsModule } from '@angular/forms'\nimport { HttpRequest } from '@angular/common/http'\n\nimport {\n NbAlertModule,\n NbButtonModule,\n NbCardModule,\n NbCheckboxModule,\n NbIconModule,\n NbInputModule,\n NbLayoutModule\n} from '@liquid-js/lyr-core'\n\nimport { NbAuthService } from './services/auth.service'\nimport { NbAuthSimpleToken, NbAuthTokenClass } from './services/token/token'\nimport { NbTokenLocalStorage, NbTokenStorage } from './services/token/token-storage'\nimport { NbTokenService } from './services/token/token.service'\nimport { NbAuthTokenParceler, NB_AUTH_FALLBACK_TOKEN } from './services/token/token-parceler'\nimport { NbAuthStrategy } from './strategies/auth-strategy'\nimport { NbAuthStrategyOptions } from './strategies/auth-strategy-options'\nimport { NbDummyAuthStrategy } from './strategies/dummy/dummy-strategy'\nimport { NbOAuth2AuthStrategy } from './strategies/oauth2/oauth2-strategy'\nimport { NbPasswordAuthStrategy } from './strategies/password/password-strategy'\n\nimport {\n defaultAuthOptions,\n NB_AUTH_INTERCEPTOR_HEADER,\n NB_AUTH_OPTIONS,\n NB_AUTH_STRATEGIES,\n NB_AUTH_TOKEN_INTERCEPTOR_FILTER,\n NB_AUTH_TOKENS,\n NB_AUTH_USER_OPTIONS,\n NbAuthOptions,\n NbAuthResolvedOptions,\n NbAuthStrategyClass\n} from './auth.options'\n\nimport { NbAuthComponent } from './components/auth.component'\n\nimport { NbAuthBlockComponent } from './components/auth-block/auth-block.component'\nimport { NbLoginComponent } from './components/login/login.component'\nimport { NbRegisterComponent } from './components/register/register.component'\nimport { NbLogoutComponent } from './components/logout/logout.component'\nimport { NbRequestPasswordComponent } from './components/request-password/request-password.component'\nimport { NbResetPasswordComponent } from './components/reset-password/reset-password.component'\n\nimport { deepExtend } from './helpers'\n\nexport function nbStrategiesFactory(options: NbAuthResolvedOptions, injector: Injector): NbAuthStrategy[] {\n const strategies = new Array<NbAuthStrategy>()\n options.strategies\n .forEach(([strategyClass, strategyOptions]: [NbAuthStrategyClass, NbAuthStrategyOptions]) => {\n const strategy: NbAuthStrategy = injector.get(strategyClass)\n strategy.setOptions(strategyOptions)\n\n strategies.push(strategy)\n })\n return strategies\n}\n\nexport function nbTokensFactory(strategies: NbAuthStrategy[]): NbAuthTokenClass[] {\n const tokens = new Array<NbAuthTokenClass>()\n strategies\n .forEach((strategy: NbAuthStrategy) => {\n const tokenClass = strategy.getOption('token.class')\n if (tokenClass) {\n tokens.push(tokenClass)\n }\n })\n return tokens\n}\n\nexport function nbOptionsFactory(options?: NbAuthOptions): NbAuthResolvedOptions {\n // Into a new object: the defaults are shared by every provideNbAuth().\n return deepExtend({}, defaultAuthOptions, options)\n}\n\nexport function nbNoOpInterceptorFilter(_req: HttpRequest<unknown>): boolean {\n return true\n}\n\n/**\n * Provides the auth services, strategies and tokens, in place of `NbAuthModule.forRoot()`.\n */\nexport function provideNbAuth(nbAuthOptions?: NbAuthOptions): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: NB_AUTH_USER_OPTIONS, useValue: nbAuthOptions },\n { provide: NB_AUTH_OPTIONS, useFactory: nbOptionsFactory, deps: [NB_AUTH_USER_OPTIONS] },\n { provide: NB_AUTH_STRATEGIES, useFactory: nbStrategiesFactory, deps: [NB_AUTH_OPTIONS, Injector] },\n { provide: NB_AUTH_TOKENS, useFactory: nbTokensFactory, deps: [NB_AUTH_STRATEGIES] },\n { provide: NB_AUTH_FALLBACK_TOKEN, useValue: NbAuthSimpleToken },\n { provide: NB_AUTH_INTERCEPTOR_HEADER, useValue: 'Authorization' },\n { provide: NB_AUTH_TOKEN_INTERCEPTOR_FILTER, useValue: nbNoOpInterceptorFilter },\n { provide: NbTokenStorage, useClass: NbTokenLocalStorage },\n NbAuthTokenParceler,\n NbAuthService,\n NbTokenService,\n NbDummyAuthStrategy,\n NbPasswordAuthStrategy,\n NbOAuth2AuthStrategy\n ])\n}\n\n@NgModule({\n imports: [\n NbLayoutModule,\n NbCardModule,\n NbCheckboxModule,\n NbAlertModule,\n NbInputModule,\n NbButtonModule,\n RouterModule,\n FormsModule,\n NbIconModule,\n NbAuthComponent,\n NbAuthBlockComponent,\n NbLoginComponent,\n NbRegisterComponent,\n NbRequestPasswordComponent,\n NbResetPasswordComponent,\n NbLogoutComponent\n ],\n exports: [\n NbAuthComponent,\n NbAuthBlockComponent,\n NbLoginComponent,\n NbRegisterComponent,\n NbRequestPasswordComponent,\n NbResetPasswordComponent,\n NbLogoutComponent\n ]\n})\nexport class NbAuthModule {\n static forRoot(nbAuthOptions?: NbAuthOptions): ModuleWithProviders<NbAuthModule> {\n return { ngModule: NbAuthModule, providers: [provideNbAuth(nbAuthOptions)] }\n }\n}\n","import { Routes } from '@angular/router'\n\nimport { NbAuthComponent } from './components/auth.component'\nimport { NbLoginComponent } from './components/login/login.component'\nimport { NbRegisterComponent } from './components/register/register.component'\nimport { NbLogoutComponent } from './components/logout/logout.component'\nimport { NbRequestPasswordComponent } from './components/request-password/request-password.component'\nimport { NbResetPasswordComponent } from './components/reset-password/reset-password.component'\n\nexport const routes: Routes = [\n {\n path: 'auth',\n component: NbAuthComponent,\n children: [\n {\n path: '',\n component: NbLoginComponent\n },\n {\n path: 'login',\n component: NbLoginComponent\n },\n {\n path: 'register',\n component: NbRegisterComponent\n },\n {\n path: 'logout',\n component: NbLogoutComponent\n },\n {\n path: 'request-password',\n component: NbRequestPasswordComponent\n },\n {\n path: 'reset-password',\n component: NbResetPasswordComponent\n }\n ]\n }\n]\n","import { Injector, inject, Service } from '@angular/core'\nimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'\nimport { Observable } from 'rxjs'\nimport { switchMap } from 'rxjs/operators'\nimport { NbAuthToken } from '../token/token'\nimport { NbAuthService } from '../auth.service'\nimport { NB_AUTH_TOKEN_INTERCEPTOR_FILTER } from '../../auth.options'\n\n/**\n * Sends the token as a `Bearer` authorization header, refreshing it first when it has expired. Without a valid token\n * the request goes without one, so the app gets the 401 or 403 and can act on it, e.g. go to the login page.\n *\n * `NB_AUTH_TOKEN_INTERCEPTOR_FILTER` says which requests to leave alone, and the default leaves all of them alone:\n * provide a filter that returns `false` for the requests that need the token.\n */\n@Service({ autoProvided: false })\nexport class NbAuthJWTInterceptor implements HttpInterceptor {\n private readonly injector = inject(Injector)\n protected readonly filter = inject(NB_AUTH_TOKEN_INTERCEPTOR_FILTER)\n\n intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n // The filter returns `true` for the requests to leave alone.\n if (!this.filter(req)) {\n return this.authService.isAuthenticatedOrRefresh()\n .pipe(\n switchMap((authenticated) => {\n if (authenticated) {\n return this.authService.getToken().pipe(\n switchMap((token: NbAuthToken) => {\n const JWT = `Bearer ${token.getValue()}`\n req = req.clone({\n setHeaders: {\n Authorization: JWT\n }\n })\n return next.handle(req)\n })\n )\n } else {\n // Request is sent to server without authentication so that the client code\n // receives the 401/403 error and can act as desired ('session expired', redirect to login, aso)\n return next.handle(req)\n }\n })\n )\n } else {\n return next.handle(req)\n }\n }\n\n protected get authService(): NbAuthService {\n return this.injector.get(NbAuthService)\n }\n\n}\n","import { Injector, inject, Service } from '@angular/core'\nimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'\nimport { Observable } from 'rxjs'\nimport { switchMap } from 'rxjs/operators'\n\nimport { NbAuthService } from '../auth.service'\nimport { NB_AUTH_INTERCEPTOR_HEADER } from '../../auth.options'\nimport { NbAuthToken } from '../token/token'\n\n/**\n * Sends the token's value as it is, in the `NB_AUTH_INTERCEPTOR_HEADER` header (`Authorization` by default), with\n * every request that goes out while there is a token.\n */\n@Service({ autoProvided: false })\nexport class NbAuthSimpleInterceptor implements HttpInterceptor {\n private readonly injector = inject(Injector)\n protected readonly headerName = inject(NB_AUTH_INTERCEPTOR_HEADER) ?? 'Authorization'\n\n intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n return this.authService.getToken().pipe(\n switchMap((token: NbAuthToken) => {\n if (token && token.getValue()) {\n req = req.clone({\n setHeaders: {\n [this.headerName]: token.getValue()\n }\n })\n }\n return next.handle(req)\n })\n )\n }\n\n protected get authService(): NbAuthService {\n return this.injector.get(NbAuthService)\n }\n}\n","export class NbUser {\n\n constructor(public id?: number,\n public email?: string,\n public password?: string,\n public rememberMe?: boolean,\n public terms?: boolean,\n public confirmPassword?: string,\n public fullName?: string) {\n }\n}\n\n/**\n * What the auth forms send to their strategy, each form its own fields: the login form the email, password and\n * \"remember me\", the register form all but \"remember me\", the request password form the email, and the reset password\n * form the password and its confirmation.\n */\nexport interface NbAuthCredentials {\n email?: string\n password?: string\n confirmPassword?: string\n fullName?: string\n rememberMe?: boolean\n terms?: boolean\n}\n"],"mappings":";;;;;;;;;;;AA4FA,MAAM,cAAc,IAAI,MAAK;AAE7B,MAAa,qBAA4C;CACrD,YAAY,CAAA;CACZ,OAAO;EACH,OAAO;GACH,eAAe;GACf,UAAU;GACV,YAAY;GACZ,cAAc;IACV,SAAS;IACT,OAAO;GACV;GACD;EACH;EACD,UAAU;GACN,eAAe;GACf,UAAU;GACV,cAAc;IACV,SAAS;IACT,OAAO;GACV;GACD,OAAO;GACP;EACH;EACD,iBAAiB;GACb,eAAe;GACf,UAAU;GACV,cAAc;IACV,SAAS;IACT,OAAO;GACV;GACD;EACH;EACD,eAAe;GACX,eAAe;GACf,UAAU;GACV,cAAc;IACV,SAAS;IACT,OAAO;GACV;GACD;EACH;EACD,QAAQ;GACJ,eAAe;GACf,UAAU;EACb;EACD,YAAY;GACR,UAAU;IACN,UAAU;IACV,WAAW;IAC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a,wBAAuB;CADpC,cAAA;EAEqB,KAAA,WAAW,OAAO,QAAQ;EACxB,KAAA,aAAa,OAAO,0BAA0B,KAAK;CAoBzE;CAlBG,UAAU,KAA2B,MAAiB;EAClD,OAAO,KAAK,YAAY,SAAQ,CAAE,CAAC,KAC/B,WAAW,UAAsB;GAC7B,IAAI,SAAS,MAAM,SAAQ,GACvB,MAAM,IAAI,MAAM,EACZ,YAAY,GACP,KAAK,aAAa,MAAM,SAAQ,EACpC,EACJ,CAAA;GAEL,OAAO,KAAK,OAAO,GAAG;EAC1B,CAAC,CAAC;CAEV;CAEA,IAAc,cAAW;EACrB,OAAO,KAAK,SAAS,IAAI,aAAa;CAC1C;CArBS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAuB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAvB;EAAA,KAAA,QAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAuB,cAAA;EAAA,CAAA;CAAA;;AAAvB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAuB,YAAA,CAAA;EADnC,MAAA;EAAQ,MAAA,CAAA,EAAE,cAAc,MAAK,CAAE;;;ACbhC,IAAa,SAAb,MAAmB;CAEf,YAAmB,IACR,OACA,UACA,YACA,OACA,iBACA,UAAiB;EANT,KAAA,KAAA;EACR,KAAA,QAAA;EACA,KAAA,WAAA;EACA,KAAA,aAAA;EACA,KAAA,QAAA;EACA,KAAA,kBAAA;EACA,KAAA,WAAA;CACX;AACH"}
package/package.json CHANGED
@@ -1,6 +1,62 @@
1
1
  {
2
2
  "name": "@liquid-js/lyr-auth",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "description": "Lyra authentication: login and registration pages, strategies, tokens and guards",
4
+ "bugs": {
5
+ "url": "https://github.com/Liquid-JS/lyra/issues"
6
+ },
7
+ "version": "22.0.0-alpha.0",
8
+ "license": "MIT",
9
+ "author": "HitkoDev <development@hitko.si>",
10
+ "type": "module",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/Liquid-JS/lyra.git"
14
+ },
15
+ "homepage": "https://github.com/Liquid-JS/lyra/tree/master/packages/auth#readme",
16
+ "keywords": [
17
+ "angular",
18
+ "typescript",
19
+ "lyra",
20
+ "ui",
21
+ "components",
22
+ "auth"
23
+ ],
24
+ "peerDependencies": {
25
+ "@angular/common": "^22.0.0",
26
+ "@angular/core": "^22.0.0",
27
+ "@angular/forms": "^22.0.0",
28
+ "@angular/router": "^22.0.0",
29
+ "@liquid-js/lyr-core": "^22.0.0",
30
+ "rxjs": "^6.5.3 || ^7.4.0"
31
+ },
32
+ "sideEffects": false,
33
+ "exports": {
34
+ "./styles/prebuilt/corporate.css": {
35
+ "style": "./styles/prebuilt/corporate.css"
36
+ },
37
+ "./styles/prebuilt/cosmic.css": {
38
+ "style": "./styles/prebuilt/cosmic.css"
39
+ },
40
+ "./styles/prebuilt/dark.css": {
41
+ "style": "./styles/prebuilt/dark.css"
42
+ },
43
+ "./styles/prebuilt/default.css": {
44
+ "style": "./styles/prebuilt/default.css"
45
+ },
46
+ "./styles/globals": {
47
+ "sass": "./styles/_globals.scss"
48
+ },
49
+ "./package.json": {
50
+ "default": "./package.json"
51
+ },
52
+ ".": {
53
+ "types": "./types/liquid-js-lyr-auth.d.ts",
54
+ "default": "./fesm2022/liquid-js-lyr-auth.mjs"
55
+ }
56
+ },
57
+ "module": "fesm2022/liquid-js-lyr-auth.mjs",
58
+ "typings": "types/liquid-js-lyr-auth.d.ts",
59
+ "dependencies": {
60
+ "tslib": "^2.9.1"
61
+ }
6
62
  }
@@ -0,0 +1,5 @@
1
+ @use "global/components";
2
+
3
+ @mixin nb-auth-global() {
4
+ @include components.nb-auth-components;
5
+ }
@@ -0,0 +1,6 @@
1
+ @use "../../components/auth-block/auth-block.component.theme" as auth-block-theme;
2
+
3
+ // Create a theme
4
+ @mixin nb-auth-components() {
5
+ @include auth-block-theme.nb-auth-block-theme;
6
+ }