Skip to content
Permalink
Browse files

fix login bug preventing --email from overriding the active team email

prior to this when --email and --team were specified the active
team email would still be used
  • Loading branch information...
tj committed Apr 17, 2018
1 parent 3ce84a0 commit 89c0afb2ba9b485efad78c367da4a3652b14dbce
Showing with 11 additions and 1 deletion.
  1. +11 −1 internal/cli/team/team.go
@@ -301,6 +301,13 @@ func login(cmd *kingpin.Cmd) {

t := config.GetActiveTeam()

// both team and email are specified,
// so we want to disregard the active team
// entirely and sign in using these creds.
if *email != "" && *team != "" {
t = nil
}

// ensure we have an email
if *email == "" {
if t == nil {
@@ -312,7 +319,10 @@ func login(cmd *kingpin.Cmd) {
}
}

// ensure we have a team if already signed-in
// ensure we have a team if already signed-in,
// this lets the user specify only --team xxx to
// join a team they were invited to, or add one
// which they own.
if t != nil && *team == "" {
util.Log("Already signed in as %s on team %s.", t.Email, t.ID)
util.Log("Use `up team login --team <id>` to join a team.")

0 comments on commit 89c0afb

Please sign in to comment.
You can’t perform that action at this time.