Skip to content

Commit

Permalink
Web login - Make the uuid a bold in green
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi committed Jul 21, 2024
1 parent 922df5d commit f2c7baa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions artifactory/utils/weblogin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ package utils

import (
"errors"
"time"

"github.com/google/uuid"
"github.com/jfrog/jfrog-cli-core/v2/utils/config"
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
"github.com/jfrog/jfrog-client-go/auth"
clientUtils "github.com/jfrog/jfrog-client-go/utils"
"github.com/jfrog/jfrog-client-go/utils/errorutils"
"github.com/jfrog/jfrog-client-go/utils/log"
"github.com/pkg/browser"
"time"
)

func DoWebLogin(serverDetails *config.ServerDetails) (token auth.CommonTokenParams, err error) {
Expand All @@ -32,7 +34,7 @@ func DoWebLogin(serverDetails *config.ServerDetails) (token auth.CommonTokenPara
"Don't worry! You can use the \"jf c add\" command to authenticate with the JFrog Platform using other methods"))
return
}
log.Info("After logging in via your web browser, please enter the code if prompted: " + uuidStr[len(uuidStr)-4:])
log.Info("After logging in via your web browser, please enter the code if prompted: " + coreutils.PrintBoldTitle(uuidStr[len(uuidStr)-4:]))
if err = browser.OpenURL(clientUtils.AddTrailingSlashIfNeeded(serverDetails.Url) + "ui/login?jfClientSession=" + uuidStr + "&jfClientName=JFrog-CLI&jfClientCode=1"); err != nil {
return
}
Expand Down

0 comments on commit f2c7baa

Please sign in to comment.