diff options
author | Michael Muré <batolettre@gmail.com> | 2020-02-14 17:04:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-14 17:04:06 +0100 |
commit | 2df72942f2b057956c7873f908b64880ab647331 (patch) | |
tree | 7d2938f7185ed6843ddd1681429b9c4f9d1e7db6 /bridge/gitlab/config.go | |
parent | 10284903e9f56d32a45e42edeb51973756743074 (diff) | |
parent | 34083de0df5187caed3f788c1dcedf7196180206 (diff) | |
download | git-bug-2df72942f2b057956c7873f908b64880ab647331.tar.gz |
Merge pull request #321 from MichaelMure/cred-password
auth: refactor and introduce Login and LoginPassword, salt IDs
Diffstat (limited to 'bridge/gitlab/config.go')
-rw-r--r-- | bridge/gitlab/config.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bridge/gitlab/config.go b/bridge/gitlab/config.go index 62d385dc..9bd9c3c7 100644 --- a/bridge/gitlab/config.go +++ b/bridge/gitlab/config.go @@ -83,7 +83,7 @@ func (g *Gitlab) Configure(repo *cache.RepoCache, params core.BridgeParams) (cor } login = l case params.TokenRaw != "": - token := auth.NewToken(params.TokenRaw, target) + token := auth.NewToken(target, params.TokenRaw) login, err = getLoginFromToken(baseUrl, token) if err != nil { return nil, err @@ -265,7 +265,7 @@ func promptToken(baseUrl string) (*auth.Token, error) { if !re.MatchString(value) { return "token has incorrect format", nil } - login, err = getLoginFromToken(baseUrl, auth.NewToken(value, target)) + login, err = getLoginFromToken(baseUrl, auth.NewToken(target, value)) if err != nil { return fmt.Sprintf("token is invalid: %v", err), nil } @@ -277,7 +277,7 @@ func promptToken(baseUrl string) (*auth.Token, error) { return nil, err } - token := auth.NewToken(rawToken, target) + token := auth.NewToken(target, rawToken) token.SetMetadata(auth.MetaKeyLogin, login) token.SetMetadata(auth.MetaKeyBaseURL, baseUrl) |