github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/internal/runbits/auth/signup.go (about)

     1  package auth
     2  
     3  import (
     4  	"github.com/ActiveState/cli/internal/errs"
     5  	"github.com/ActiveState/cli/internal/keypairs"
     6  	"github.com/ActiveState/cli/internal/locale"
     7  	"github.com/ActiveState/cli/internal/logging"
     8  	"github.com/ActiveState/cli/internal/output"
     9  	"github.com/ActiveState/cli/internal/prompt"
    10  	"github.com/ActiveState/cli/pkg/platform/authentication"
    11  )
    12  
    13  func SignupWithBrowser(out output.Outputer, auth *authentication.Auth, prompt prompt.Prompter, cfg keypairs.Configurable) error {
    14  	logging.Debug("Signing up with browser")
    15  
    16  	err := authenticateWithBrowser(out, auth, prompt, cfg, true)
    17  	if err != nil {
    18  		return errs.Wrap(err, "Error signing up with browser")
    19  	}
    20  
    21  	out.Notice(locale.Tl("auth_signup_success", "Successfully signed up and authorized this device"))
    22  
    23  	return nil
    24  }