File tree 4 files changed +12
-12
lines changed
arduino-ide-extension/src
4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -43,15 +43,15 @@ export class AuthenticationClientService
43
43
44
44
readonly onSessionDidChange = this . onSessionDidChangeEmitter . event ;
45
45
46
- onStart ( ) : void {
46
+ async onStart ( ) : Promise < void > {
47
47
this . toDispose . push ( this . onSessionDidChangeEmitter ) ;
48
48
this . service . setClient ( this ) ;
49
49
this . service
50
50
. session ( )
51
51
. then ( ( session ) => this . notifySessionDidChange ( session ) ) ;
52
52
53
- this . setOptions ( ) ;
54
- this . service . initAuthSession ( )
53
+ await this . setOptions ( ) ;
54
+ this . service . initAuthSession ( ) ;
55
55
56
56
this . arduinoPreferences . onPreferenceChanged ( ( event ) => {
57
57
if ( event . preferenceName . startsWith ( 'arduino.auth.' ) ) {
@@ -60,8 +60,8 @@ export class AuthenticationClientService
60
60
} ) ;
61
61
}
62
62
63
- setOptions ( ) : void {
64
- this . service . setOptions ( {
63
+ setOptions ( ) : Promise < void > {
64
+ return this . service . setOptions ( {
65
65
redirectUri : `http://localhost:${ serverPort } /callback` ,
66
66
responseType : 'code' ,
67
67
clientID : this . arduinoPreferences [ 'arduino.auth.clientID' ] ,
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export interface AuthenticationService
22
22
logout ( ) : Promise < void > ;
23
23
session ( ) : Promise < AuthenticationSession | undefined > ;
24
24
disposeClient ( client : AuthenticationServiceClient ) : void ;
25
- setOptions ( authOptions : AuthOptions ) : void ;
25
+ setOptions ( authOptions : AuthOptions ) : Promise < void > ;
26
26
initAuthSession ( ) : Promise < void > ;
27
27
}
28
28
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ export class ArduinoAuthenticationProvider implements AuthenticationProvider {
89
89
setInterval ( checkToken , REFRESH_INTERVAL ) ;
90
90
}
91
91
92
- public setOptions ( authOptions : AuthOptions ) {
92
+ public async setOptions ( authOptions : AuthOptions ) : Promise < void > {
93
93
this . authOptions = authOptions ;
94
94
}
95
95
Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ export class AuthenticationServiceImpl
19
19
protected readonly delegate = new ArduinoAuthenticationProvider ( ) ;
20
20
protected readonly clients : AuthenticationServiceClient [ ] = [ ] ;
21
21
protected readonly toDispose = new DisposableCollection ( ) ;
22
-
23
- private initialized = false ;
22
+
23
+ private initialized = false ;
24
24
25
25
async onStart ( ) : Promise < void > {
26
26
this . toDispose . pushAll ( [
@@ -49,12 +49,12 @@ export class AuthenticationServiceImpl
49
49
async initAuthSession ( ) : Promise < void > {
50
50
if ( ! this . initialized ) {
51
51
await this . delegate . init ( ) ;
52
- this . initialized = true
52
+ this . initialized = true ;
53
53
}
54
54
}
55
55
56
- setOptions ( authOptions : AuthOptions ) {
57
- this . delegate . setOptions ( authOptions ) ;
56
+ setOptions ( authOptions : AuthOptions ) : Promise < void > {
57
+ return this . delegate . setOptions ( authOptions ) ;
58
58
}
59
59
60
60
async login ( ) : Promise < AuthenticationSession > {
You can’t perform that action at this time.
0 commit comments