(account: Account, options: Options)
| 40 | |
| 41 | // helper to determine if VSCode options has the same account as global default |
| 42 | function isUserMatching(account: Account, options: Options) { |
| 43 | if (!options.user || !options.tokens) { |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | const optionsUser = options.user as User; |
| 48 | const optionsTokens = options.tokens as Tokens; |
| 49 | return ( |
| 50 | account && |
| 51 | account.user?.email === optionsUser.email && |
| 52 | account.tokens.refresh_token === optionsTokens.refresh_token // Should check refresh token which is consistent, not access_token which is short lived. |
| 53 | ); |
| 54 | } |
| 55 | |
| 56 | // only add account options when vscode is missing account information |
| 57 | if (!isUserMatching(account!, currentOptions.value)) { |
no outgoing calls
no test coverage detected
searching dependent graphs…