From 63c2c3d59fabfe3679bf8a2851c1e716a0cf4120 Mon Sep 17 00:00:00 2001 From: Dane Schneider Date: Thu, 16 May 2024 13:15:12 -0700 Subject: [PATCH] Fixes for some account creation flow issues, closes #106 --- app/cli/auth/account.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/app/cli/auth/account.go b/app/cli/auth/account.go index 0cbecbcf..955740a9 100644 --- a/app/cli/auth/account.go +++ b/app/cli/auth/account.go @@ -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) { @@ -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 }