Skip to content

Commit

Permalink
Fixes for some account creation flow issues, closes #106
Browse files Browse the repository at this point in the history
  • Loading branch information
danenania committed May 16, 2024
1 parent 42c8cb6 commit 63c2c3d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions app/cli/auth/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,23 @@ func promptSignInNewAccount() error {
}

if hasAccount {
return signIn(email, pin, host)
err := signIn(email, pin, host)
if err != nil {
return fmt.Errorf("error signing in: %v", err)
}
} else {
return createAccount(email, pin, host)
err := createAccount(email, pin, host)
if err != nil {
return fmt.Errorf("error creating account: %v", err)
}
}

fmt.Printf("✅ Signed in as %s | Org: %s\n", color.New(color.Bold, term.ColorHiGreen).Sprintf("<%s> %s", Current.UserName, Current.Email), color.New(term.ColorHiCyan).Sprint(Current.OrgName))
fmt.Println()

term.PrintCmds("", "new", "plans")

return nil
}

func verifyEmail(email, host string) (bool, string, error) {
Expand Down Expand Up @@ -245,6 +258,9 @@ func signIn(email, pin, host string) error {
return fmt.Errorf("error writing auth: %v", err)
}

fmt.Printf("✅ Signed in as %s | Org: %s\n", color.New(color.Bold, term.ColorHiGreen).Sprintf("<%s> %s", Current.UserName, Current.Email), color.New(term.ColorHiCyan).Sprint(Current.OrgName))
fmt.Println()

return nil
}

Expand Down

0 comments on commit 63c2c3d

Please sign in to comment.