UNPKG

2 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright Akveo. All Rights Reserved.
4 * Licensed under the MIT License. See License.txt in the project root for license information.
5 */
6import { NbAuthTokenClass } from '../../services/token/token';
7import { NbAuthStrategyOptions } from '../auth-strategy-options';
8export interface NbPasswordStrategyModule {
9 alwaysFail?: boolean;
10 endpoint?: string;
11 method?: string;
12 redirect?: {
13 success?: string | null;
14 failure?: string | null;
15 };
16 requireValidToken?: boolean;
17 defaultErrors?: string[];
18 defaultMessages?: string[];
19}
20export interface NbPasswordStrategyReset extends NbPasswordStrategyModule {
21 resetPasswordTokenKey?: string;
22}
23export interface NbPasswordStrategyToken {
24 class?: NbAuthTokenClass;
25 key?: string;
26 getter?: Function;
27}
28export interface NbPasswordStrategyMessage {
29 key?: string;
30 getter?: Function;
31}
32export declare class NbPasswordAuthStrategyOptions extends NbAuthStrategyOptions {
33 baseEndpoint?: string;
34 login?: boolean | NbPasswordStrategyModule;
35 register?: boolean | NbPasswordStrategyModule;
36 requestPass?: boolean | NbPasswordStrategyModule;
37 resetPass?: boolean | NbPasswordStrategyReset;
38 logout?: boolean | NbPasswordStrategyReset;
39 refreshToken?: boolean | NbPasswordStrategyModule;
40 token?: NbPasswordStrategyToken;
41 errors?: NbPasswordStrategyMessage;
42 messages?: NbPasswordStrategyMessage;
43 validation?: {
44 password?: {
45 required?: boolean;
46 minLength?: number | null;
47 maxLength?: number | null;
48 regexp?: string | null;
49 };
50 email?: {
51 required?: boolean;
52 regexp?: string | null;
53 };
54 fullName?: {
55 required?: boolean;
56 minLength?: number | null;
57 maxLength?: number | null;
58 regexp?: string | null;
59 };
60 };
61}
62export declare const passwordStrategyOptions: NbPasswordAuthStrategyOptions;