@@ -437,7 +437,8 @@ export class AuthController extends BaseController {
437
437
login (
438
438
strategy : string ,
439
439
credentials : JSONObject ,
440
- expiresIn ?: string | number
440
+ expiresIn ?: string | number ,
441
+ options : ArgsAuthControllerLogin = { }
441
442
) : Promise < string > {
442
443
const request = {
443
444
action : "login" ,
@@ -448,7 +449,12 @@ export class AuthController extends BaseController {
448
449
} ;
449
450
450
451
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
+ } )
452
458
. then ( ( response ) => {
453
459
if ( this . kuzzle . cookieAuthentication ) {
454
460
if ( response . result . jwt ) {
@@ -497,15 +503,15 @@ export class AuthController extends BaseController {
497
503
*
498
504
* @see https://docs.kuzzle.io/sdk/js/7/controllers/auth/logout
499
505
*/
500
- async logout ( ) : Promise < void > {
506
+ async logout ( options : ArgsAuthControllerLogin = { } ) : Promise < void > {
501
507
this . kuzzle . emit ( "beforeLogout" ) ;
502
508
try {
503
509
await this . query (
504
510
{
505
511
action : "logout" ,
506
512
cookieAuth : this . kuzzle . cookieAuthentication ,
507
513
} ,
508
- { queuable : false , timeout : - 1 }
514
+ { queuable : false , timeout : - 1 , ... options }
509
515
) ;
510
516
this . _authenticationToken = null ;
511
517
/**
@@ -700,6 +706,10 @@ export type ArgsAuthControllerUpdateSelf = ArgsDefault;
700
706
701
707
export type ArgsAuthControllerValidateMyCredentials = ArgsDefault ;
702
708
709
+ export type ArgsAuthControllerLogin = ArgsDefault ;
710
+
711
+ export type ArgsAuthControllerLogout = ArgsDefault ;
712
+
703
713
export interface ArgsAuthControllerRefreshToken extends ArgsDefault {
704
714
expiresIn ?: number | string ;
705
715
}
0 commit comments