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 @@ -252,14 +252,14 @@ export class Commands {
252252 vscode . workspace . getConfiguration ( ) ,
253253 ) ;
254254 const needsToken = needToken ( vscode . workspace . getConfiguration ( ) ) ;
255- try {
256- const user = await client . getAuthenticatedUser ( ) ;
257- // For non-token auth, we write a blank token since the `vscodessh`
258- // command currently always requires a token file.
259- // For token auth, we have valid access so we can just return the user here
260- return { token : needsToken && token ? token : "" , user } ;
261- } catch ( err ) {
262- if ( ! needToken ( vscode . workspace . getConfiguration ( ) ) ) {
255+ if ( ! needsToken || token ) {
256+ try {
257+ const user = await client . getAuthenticatedUser ( ) ;
258+ // For non-token auth, we write a blank token since the `vscodessh`
259+ // command currently always requires a token file.
260+ // For token auth, we have valid access so we can just return the user here
261+ return { token : needsToken && token ? token : "" , user } ;
262+ } catch ( err ) {
263263 const message = getErrorMessage ( err , "no response from the server" ) ;
264264 if ( isAutoLogin ) {
265265 this . logger . warn ( "Failed to log in to Coder server:" , message ) ;
You can’t perform that action at this time.
0 commit comments