11import merge from 'lodash/merge' ;
22import { NotAuthenticated } from '@feathersjs/errors' ;
3- import { AuthenticationBase , AuthenticationResult , AuthenticationRequest } from './core' ;
3+ import { AuthenticationBase , AuthenticationResult , AuthenticationRequest , AuthenticationParams } from './core' ;
44import { connection , event } from './hooks' ;
55import '@feathersjs/transport-commons' ;
66import { createDebug } from '@feathersjs/commons' ;
7- import { Params , ServiceMethods , ServiceAddons } from '@feathersjs/feathers' ;
7+ import { ServiceMethods , ServiceAddons } from '@feathersjs/feathers' ;
88import jsonwebtoken from 'jsonwebtoken' ;
99
1010const debug = createDebug ( '@feathersjs/authentication/service' ) ;
@@ -29,7 +29,7 @@ declare module '@feathersjs/feathers/lib/declarations' {
2929// eslint-disable-next-line
3030export interface AuthenticationService extends ServiceAddons < AuthenticationResult , AuthenticationResult > { }
3131
32- export class AuthenticationService extends AuthenticationBase implements Partial < ServiceMethods < AuthenticationResult > > {
32+ export class AuthenticationService extends AuthenticationBase implements Partial < ServiceMethods < AuthenticationResult , AuthenticationRequest , AuthenticationParams > > {
3333 constructor ( app : any , configKey = 'authentication' , options = { } ) {
3434 super ( app , configKey , options ) ;
3535
@@ -51,7 +51,7 @@ export class AuthenticationService extends AuthenticationBase implements Partial
5151 * @param _authResult The current authentication result
5252 * @param params The service call parameters
5353 */
54- async getPayload ( _authResult : AuthenticationResult , params : Params ) {
54+ async getPayload ( _authResult : AuthenticationResult , params : AuthenticationParams ) {
5555 // Uses `params.payload` or returns an empty payload
5656 const { payload = { } } = params ;
5757
@@ -65,7 +65,7 @@ export class AuthenticationService extends AuthenticationBase implements Partial
6565 * @param authResult The authentication result
6666 * @param params Service call parameters
6767 */
68- async getTokenOptions ( authResult : AuthenticationResult , params : Params ) {
68+ async getTokenOptions ( authResult : AuthenticationResult , params : AuthenticationParams ) {
6969 const { service, entity, entityId } = this . configuration ;
7070 const jwtOptions = merge ( { } , params . jwtOptions , params . jwt ) ;
7171 const value = service && entity && authResult [ entity ] ;
@@ -92,7 +92,7 @@ export class AuthenticationService extends AuthenticationBase implements Partial
9292 * @param data The authentication request (should include `strategy` key)
9393 * @param params Service call parameters
9494 */
95- async create ( data : AuthenticationRequest , params ?: Params ) {
95+ async create ( data : AuthenticationRequest , params ?: AuthenticationParams ) {
9696 const authStrategies = params . authStrategies || this . configuration . authStrategies ;
9797
9898 if ( ! authStrategies . length ) {
@@ -131,7 +131,7 @@ export class AuthenticationService extends AuthenticationBase implements Partial
131131 * @param id The JWT to remove or null
132132 * @param params Service call parameters
133133 */
134- async remove ( id : string | null , params ?: Params ) {
134+ async remove ( id : string | null , params ?: AuthenticationParams ) {
135135 const { authentication } = params ;
136136 const { authStrategies } = this . configuration ;
137137
0 commit comments