npm install --save @types/feathersjs__authentication-local
This package contains type definitions for @feathersjs/authentication-local (https://feathersjs.com).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/feathersjs__authentication-local.
import { Application, Hook, Paginated } from "@feathersjs/feathers";
import { Request } from "express";
// eslint-disable-next-line @definitelytyped/no-self-import
import * as self from "@feathersjs/authentication-local";
declare const feathersAuthenticationLocal:
& ((options?: Partial<FeathersAuthenticationLocalOptions>) => () => void)
& typeof self;
export default feathersAuthenticationLocal;
export interface FeathersAuthenticationLocalOptions {
/**
* the name to use when invoking the authentication Strategy
*/
name: string;
/**
* the entity that you're comparing username/password against
*/
entity: string;
/**
* the service to look up the entity
*/
service: string;
/**
* key name of username field on the request
*/
usernameField: string;
/**
* key name of password field on the request
*/
passwordField: string;
/**
* key name of the username field on the entity (defaults to `usernameField`)
*/
entityUsernameField: string;
/**
* key name of the password on the entity (defaults to `passwordField`)
*/
entityPasswordField: string;
/**
* whether the request object should be passed to `verify`
*/
passReqToCallback: boolean;
/**
* whether to use sessions,
*/
session: boolean;
/**
* A Verifier class. Defaults to the built-in one but can be a custom one. See below for details.
*/
Verifier: LocalVerifier;
}
export class LocalVerifier {
constructor(app: Application, options: any);
_comparePassword<T>(entity: T, password: string): Promise<T>; // compares password using bcrypt
_normalizeResult<T>(results: T[] | Paginated<T>): Promise<T>; // normalizes result from service to account for pagination
verify(
req: Request,
username: string,
password: string,
done: (error: any, user?: any, options?: { message: string }) => void,
): void;
}
export namespace hooks {
function hashPassword(options?: any): Hook; // todo: properly type options
function protect(...fields: string[]): Hook;
}
export const defaults: {
name: string;
usernameField: string;
passwordField: string;
};
- Last updated: Tue, 07 Nov 2023 03:09:37 GMT
- Dependencies: @types/express, @types/feathersjs__feathers
These definitions were written by Jan Lohage.