Skip to content

Commit

Permalink
set project from token successful login
Browse files Browse the repository at this point in the history
  • Loading branch information
abelanger5 committed Jun 22, 2021
1 parent 7d6ad80 commit 86e6ca8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli/cmd/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ func login() error {
// set the token if the user calls login with the --token flag
config.SetToken(config.Token)
color.New(color.FgGreen).Println("Successfully logged in!")

projID, err := api.GetProjectIDFromToken(token)

if err != nil {
return err
}

config.SetProject(projID)
} else {
color.Yellow("You are already logged in. If you'd like to log out, run \"porter auth logout\".")
}
Expand Down

0 comments on commit 86e6ca8

Please sign in to comment.