mirror of
https://github.com/railwayapp/cli
synced 2026-04-21 14:07:23 +00:00
* Add Linting for CLI * Fire CI * Remove checkout oopsie * Newlint * Clean modcache for now * Lint fixes * Fix failed to write error * Fix CI issues * Workflow comments * Fix print lint errs * Fix * Fix lint issues * Update cmd/build.go Co-authored-by: Jake Runzer <jakerunzer@gmail.com> * Update cmd/whoami.go Co-authored-by: Jake Runzer <jakerunzer@gmail.com> Co-authored-by: Jake Runzer <jakerunzer@gmail.com>
25 lines
462 B
Go
25 lines
462 B
Go
package cmd
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/railwayapp/cli/entity"
|
|
"github.com/railwayapp/cli/ui"
|
|
)
|
|
|
|
func (h *Handler) Login(ctx context.Context, req *entity.CommandRequest) error {
|
|
isBrowserless, err := req.Cmd.Flags().GetBool("browserless")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
user, err := h.ctrl.Login(ctx, isBrowserless)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Printf("\n🎉 Logged in as %s (%s)\n", ui.Bold(user.Name), user.Email)
|
|
|
|
return nil
|
|
}
|