Add express and service to @feathersjs/authentication

This commit is contained in:
NickBolles
2019-01-15 00:13:03 -06:00
parent a4c07cbac6
commit 40710eda15
+25 -1
View File
@@ -1,11 +1,15 @@
// Type definitions for @feathersjs/authentication 2.1
// Project: http://feathersjs.com/
// Definitions by: Abraao Alves <https://github.com/AbraaoAlves>, Jan Lohage <https://github.com/j2L4e>
// Definitions by: Abraao Alves <https://github.com/AbraaoAlves>
// Jan Lohage <https://github.com/j2L4e>
// Nick Bolles <https://github.com/NickBolles>
// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript
// TypeScript Version: 2.3
import { Hook } from '@feathersjs/feathers';
import * as self from '@feathersjs/authentication';
import { RequestHandler, Application } from 'express';
import { create } from 'domain';
declare const feathersAuthentication: ((config?: FeathersAuthenticationOptions) => () => void) & typeof self;
export default feathersAuthentication;
@@ -52,6 +56,26 @@ export interface FeathersAuthenticationOptions {
};
}
export namespace express {
function exposeHeaders(): RequestHandler;
function exposeCookies(): RequestHandler;
function authenticate(strategy: string | string[], options?: FeathersAuthenticationOptions): RequestHandler;
function setCookie(options?: FeathersAuthenticationOptions): RequestHandler;
function successRedirect(): RequestHandler;
function failureRedirect(options?: FeathersAuthenticationOptions): RequestHandler;
function emitEvents(): RequestHandler;
}
export function service(options: FeathersAuthenticationOptions): (app?: Application) => void;
export namespace service {
class Service {
constructor(app: Application)
create(data: any, params: any): Promise<{ accessToken: string }>;
remove(id: null | string, params: any): Promise<{ accessToken: string }>;
}
}
export namespace AuthHooks {
interface HashPassOptions {
passwordField: string;