File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -265,14 +265,14 @@ export class Commands {
265265 vscode . workspace . getConfiguration ( ) ,
266266 ) ;
267267 const needsToken = needToken ( vscode . workspace . getConfiguration ( ) ) ;
268- try {
269- const user = await client . getAuthenticatedUser ( ) ;
270- // For non-token auth, we write a blank token since the `vscodessh`
271- // command currently always requires a token file.
272- // For token auth, we have valid access so we can just return the user here
273- return { token : needsToken && token ? token : "" , user } ;
274- } catch ( err ) {
275- if ( ! needToken ( vscode . workspace . getConfiguration ( ) ) ) {
268+ if ( ! needsToken || token ) {
269+ try {
270+ const user = await client . getAuthenticatedUser ( ) ;
271+ // For non-token auth, we write a blank token since the `vscodessh`
272+ // command currently always requires a token file.
273+ // For token auth, we have valid access so we can just return the user here
274+ return { token : needsToken && token ? token : "" , user } ;
275+ } catch ( err ) {
276276 const message = getErrorMessage ( err , "no response from the server" ) ;
277277 if ( isAutoLogin ) {
278278 this . logger . warn ( "Failed to log in to Coder server:" , message ) ;
You can’t perform that action at this time.
0 commit comments