File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
src/vs/workbench/services/authentication/browser Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -92,13 +92,17 @@ export type AuthenticationSessionInfo = { readonly id: string; readonly accessTo
92
92
export async function getCurrentAuthenticationSessionInfo ( credentialsService : ICredentialsService , productService : IProductService ) : Promise < AuthenticationSessionInfo | undefined > {
93
93
const authenticationSessionValue = await credentialsService . getPassword ( `${ productService . urlProtocol } .login` , 'account' ) ;
94
94
if ( authenticationSessionValue ) {
95
- const authenticationSessionInfo : AuthenticationSessionInfo = JSON . parse ( authenticationSessionValue ) ;
96
- if ( authenticationSessionInfo
97
- && isString ( authenticationSessionInfo . id )
98
- && isString ( authenticationSessionInfo . accessToken )
99
- && isString ( authenticationSessionInfo . providerId )
100
- ) {
101
- return authenticationSessionInfo ;
95
+ try {
96
+ const authenticationSessionInfo : AuthenticationSessionInfo = JSON . parse ( authenticationSessionValue ) ;
97
+ if ( authenticationSessionInfo
98
+ && isString ( authenticationSessionInfo . id )
99
+ && isString ( authenticationSessionInfo . accessToken )
100
+ && isString ( authenticationSessionInfo . providerId )
101
+ ) {
102
+ return authenticationSessionInfo ;
103
+ }
104
+ } catch ( e ) {
105
+ // ignore as this is a best effort operation.
102
106
}
103
107
}
104
108
return undefined ;
You can’t perform that action at this time.
0 commit comments