Skip to content

Commit b9db8fe

Browse files
fix: brev-open-command-triggers-two-concurrent-interactive-login-prompts
1 parent 83ace83 commit b9db8fe

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pkg/cmd/open/open.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ type OpenStore interface {
110110
GetWorkspace(workspaceID string) (*entity.Workspace, error)
111111
GetWindowsDir() (string, error)
112112
IsWorkspace() (bool, error)
113+
GetAccessToken() (string, error)
113114
}
114115

115116
func NewCmdOpen(t *terminal.Terminal, store OpenStore, noLoginStartStore OpenStore) *cobra.Command {
@@ -280,6 +281,9 @@ func handleSetDefault(t *terminal.Terminal, editorType string) error {
280281

281282
// Fetch workspace info, then open code editor
282283
func runOpenCommand(t *terminal.Terminal, tstore OpenStore, wsIDOrName string, setupDoneString string, directory string, host bool, editorType string) error { //nolint:funlen,gocyclo // define brev command
284+
if _, err := tstore.GetAccessToken(); err != nil {
285+
return breverrors.WrapAndTrace(err)
286+
}
283287
// todo check if workspace is stopped and start if it if it is stopped
284288
fmt.Println("finding your instance...")
285289
res := refresh.RunRefreshAsync(tstore)

0 commit comments

Comments
 (0)