Skip to content

Commit

Permalink
APP-7706 - fix ensureloggedin logic for api key login (#4812)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuqdog authored and 10zingpd committed Feb 25, 2025
1 parent f60083f commit af8d349
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ type loginWithAPIKeyArgs struct {

// LoginWithAPIKeyAction is the corresponding Action for `login api-key`.
func LoginWithAPIKeyAction(cCtx *cli.Context, args loginWithAPIKeyArgs) error {
c, err := newViamClient(cCtx)
c, err := newViamClientInner(cCtx, false)
if err != nil {
return err
}
Expand All @@ -209,6 +209,9 @@ func (c viamClient) loginWithAPIKeyAction(cCtx *cli.Context, args loginWithAPIKe
KeyCrypto: args.Key,
}
c.conf.Auth = &key
if err := c.ensureLoggedIn(); err != nil {
return err
}
if err := storeConfigToCache(c.conf); err != nil {
return err
}
Expand Down

0 comments on commit af8d349

Please sign in to comment.