import { Executor, Ident, Store, Context, Mailer, Service, User, Core } from "../index"; interface PasswordVerifier extends Service { validate(password: string): Promise; } declare class PasswordRecoveryInfos { expire: number; token: string; login: string; } /** * This class is known as the Authentication module * It handles OAuth for several providers for now (Facebook, Google, Amazon, GitHub and Twitter) * It also handles email authentication with prevalidation or postvalidation of the email * * It requires two Store to work one 'idents' and one 'users' * * The parameters are * * providerName: { * clientID: '...', * clientSecret: '...', * scope: '' * }, * email: { * postValidation: true|false // If postValidation=true, account created without email verification * } * expose: 'url' // By default /auth * */ declare class Authentication extends Executor { /** @ignore */ _identsStore: Store; _usersStore: Store; _passwordVerifier: PasswordVerifier; _aliases: Map; _emailDelay: number; _oauth1: any; constructor(webda: Core, name: string, params: any); initRoutes(): void; _googleToken(context: Context): Promise; setIdents(identStore: any): void; setUsers(userStore: any): void; /** * @ignore * Setup the default routes */ init(): Promise; addProvider(name: string, strategy: any, config: any): void; _sendEmailValidation(ctx: any): Promise; _callback(ctx: Context): Promise; _getMe(ctx: Context): Promise; _listAuthentications(ctx: Context): Promise; getCallbackUrl(ctx: Context): any; _registerNewEmail(ctx: any): Promise; handleOAuthReturn(ctx: Context, identArg: any, done: any, noRedirect?: boolean): Promise; setupOAuth(ctx: Context, config: any, name: string): void; registerUser(ctx: Context, datas: any, user?: any): Promise; getPasswordRecoveryInfos(uuid: string | User, interval?: number): Promise; _passwordRecoveryEmail(ctx: Context): Promise; _verifyPassword(password: string): Promise | Promise; _passwordRecovery(ctx: Context): Promise; _handleEmailCallback(ctx: Context): Promise; sendRecoveryEmail(ctx: Context, user: any, email: string): Promise; sendValidationEmail(ctx: Context, email: string): Promise; hashPassword(pass: string): string; logout(ctx: Context): Promise; login(ctx: Context, user: any, ident: any): Promise; getMailMan(): Mailer; protected handleLogin(ctx: Context, ident: Ident): Promise; _handleEmail(ctx: Context): Promise; generateEmailValidationToken(user: string, email: string): string; _getProviderName(name: string): any; _authenticate(ctx: Context): Promise; static getModda(): { uuid: string; label: string; description: string; webcomponents: any[]; logo: string; documentation: string; configuration: { default: { successRedirect: string; failureRedirect: string; providers: { facebook: { clientID: string; clientSecret: string; scope: string[]; }; email: { postValidation: boolean; }; }; }; schema: { type: string; properties: { expose: { type: string; }; successRedirect: { type: string; }; failureRedirect: { type: string; }; providers: { type: string; }; }; required: string[]; }; }; }; } export { Authentication, PasswordVerifier, PasswordRecoveryInfos };