aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/github/config.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-14 17:04:06 +0100
committerGitHub <noreply@github.com>2020-02-14 17:04:06 +0100
commit2df72942f2b057956c7873f908b64880ab647331 (patch)
tree7d2938f7185ed6843ddd1681429b9c4f9d1e7db6 /bridge/github/config.go
parent10284903e9f56d32a45e42edeb51973756743074 (diff)
parent34083de0df5187caed3f788c1dcedf7196180206 (diff)
downloadgit-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/github/config.go')
-rw-r--r--bridge/github/config.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/bridge/github/config.go b/bridge/github/config.go
index cc312230..afb8086c 100644
--- a/bridge/github/config.go
+++ b/bridge/github/config.go
@@ -86,7 +86,7 @@ func (g *Github) 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(token)
if err != nil {
return nil, err
@@ -296,7 +296,7 @@ func promptTokenOptions(repo repository.RepoConfig, login, owner, project string
if err != nil {
return nil, err
}
- token := auth.NewToken(value, target)
+ token := auth.NewToken(target, value)
token.SetMetadata(auth.MetaKeyLogin, login)
return token, nil
default:
@@ -327,7 +327,7 @@ func promptToken() (*auth.Token, error) {
if !re.MatchString(value) {
return "token has incorrect format", nil
}
- login, err = getLoginFromToken(auth.NewToken(value, target))
+ login, err = getLoginFromToken(auth.NewToken(target, value))
if err != nil {
return fmt.Sprintf("token is invalid: %v", err), nil
}
@@ -339,7 +339,7 @@ func promptToken() (*auth.Token, error) {
return nil, err
}
- token := auth.NewToken(rawToken, target)
+ token := auth.NewToken(target, rawToken)
token.SetMetadata(auth.MetaKeyLogin, login)
return token, nil