@@ -437,7 +437,8 @@ export class AuthController extends BaseController {
437437 login (
438438 strategy : string ,
439439 credentials : JSONObject ,
440- expiresIn ?: string | number
440+ expiresIn ?: string | number ,
441+ options : ArgsAuthControllerLogin = { }
441442 ) : Promise < string > {
442443 const request = {
443444 action : "login" ,
@@ -448,7 +449,12 @@ export class AuthController extends BaseController {
448449 } ;
449450
450451 this . kuzzle . emit ( "beforeLogin" ) ;
451- return this . query ( request , { queuable : false , timeout : - 1 , verb : "POST" } )
452+ return this . query ( request , {
453+ queuable : false ,
454+ timeout : - 1 ,
455+ verb : "POST" ,
456+ ...options ,
457+ } )
452458 . then ( ( response ) => {
453459 if ( this . kuzzle . cookieAuthentication ) {
454460 if ( response . result . jwt ) {
@@ -497,15 +503,15 @@ export class AuthController extends BaseController {
497503 *
498504 * @see https://docs.kuzzle.io/sdk/js/7/controllers/auth/logout
499505 */
500- async logout ( ) : Promise < void > {
506+ async logout ( options : ArgsAuthControllerLogin = { } ) : Promise < void > {
501507 this . kuzzle . emit ( "beforeLogout" ) ;
502508 try {
503509 await this . query (
504510 {
505511 action : "logout" ,
506512 cookieAuth : this . kuzzle . cookieAuthentication ,
507513 } ,
508- { queuable : false , timeout : - 1 }
514+ { queuable : false , timeout : - 1 , ... options }
509515 ) ;
510516 this . _authenticationToken = null ;
511517 /**
@@ -700,6 +706,10 @@ export type ArgsAuthControllerUpdateSelf = ArgsDefault;
700706
701707export type ArgsAuthControllerValidateMyCredentials = ArgsDefault ;
702708
709+ export type ArgsAuthControllerLogin = ArgsDefault ;
710+
711+ export type ArgsAuthControllerLogout = ArgsDefault ;
712+
703713export interface ArgsAuthControllerRefreshToken extends ArgsDefault {
704714 expiresIn ?: number | string ;
705715}
0 commit comments