File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
extensions/microsoft-authentication/src/node Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,6 @@ export class MsalAuthProvider implements AuthenticationProvider {
233
233
const session = this . sessionFromAuthenticationResult ( result , scopeData . originalScopes ) ;
234
234
this . _telemetryReporter . sendLoginEvent ( session . scopes ) ;
235
235
this . _logger . info ( '[createSession]' , `[${ scopeData . scopeStr } ]` , 'returned session' ) ;
236
- this . _onDidChangeSessionsEmitter . fire ( { added : [ session ] , changed : [ ] , removed : [ ] } ) ;
237
236
return session ;
238
237
} catch ( e ) {
239
238
lastError = e ;
Original file line number Diff line number Diff line change @@ -149,22 +149,26 @@ export class CachedPublicClientApplication implements ICachedPublicClientApplica
149
149
150
150
async acquireTokenInteractive ( request : InteractiveRequest ) : Promise < AuthenticationResult > {
151
151
this . _logger . debug ( `[acquireTokenInteractive] [${ this . _clientId } ] [${ this . _authority } ] [${ request . scopes ?. join ( ' ' ) } ] loopbackClientOverride: ${ request . loopbackClient ? 'true' : 'false' } ` ) ;
152
- const result = await window . withProgress (
152
+ return await window . withProgress (
153
153
{
154
154
location : ProgressLocation . Notification ,
155
155
cancellable : true ,
156
156
title : l10n . t ( 'Signing in to Microsoft...' )
157
157
} ,
158
- ( _process , token ) => this . _sequencer . queue ( ( ) => raceCancellationAndTimeoutError (
159
- this . _pca . acquireTokenInteractive ( request ) ,
160
- token ,
161
- 1000 * 60 * 5
162
- ) )
158
+ ( _process , token ) => this . _sequencer . queue ( async ( ) => {
159
+ const result = await raceCancellationAndTimeoutError (
160
+ this . _pca . acquireTokenInteractive ( request ) ,
161
+ token ,
162
+ 1000 * 60 * 5
163
+ ) ;
164
+ if ( this . _isBrokerAvailable ) {
165
+ await this . _accountAccess . setAllowedAccess ( result . account ! , true ) ;
166
+ }
167
+ // Force an update so that the account cache is updated
168
+ await this . _update ( ) ;
169
+ return result ;
170
+ } )
163
171
) ;
164
- if ( this . _isBrokerAvailable ) {
165
- await this . _accountAccess . setAllowedAccess ( result . account ! , true ) ;
166
- }
167
- return result ;
168
172
}
169
173
170
174
/**
You can’t perform that action at this time.
0 commit comments