diff options
author | Josh Bialkowski <josh.bialkowski@gmail.com> | 2020-02-17 12:43:42 -0800 |
---|---|---|
committer | Josh Bialkowski <josh.bialkowski@gmail.com> | 2020-02-17 12:43:42 -0800 |
commit | bbd31adbfff9d3c57eed7be68250b56a4386d02b (patch) | |
tree | b692d153c477d7d3e484724d37ce4a81a2b9c5c3 | |
parent | 01b0a931f737080c46373bee08bb4a21e932140a (diff) | |
download | git-bug-bbd31adbfff9d3c57eed7be68250b56a4386d02b.tar.gz |
Fix jira bridge config didn't save credentials or store URL metadata
-rw-r--r-- | bridge/jira/config.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bridge/jira/config.go b/bridge/jira/config.go index db52b83d..79fd8507 100644 --- a/bridge/jira/config.go +++ b/bridge/jira/config.go @@ -120,6 +120,14 @@ func (j *Jira) Configure(repo *cache.RepoCache, params core.BridgeParams) (core. project, baseURL, login) } + // don't forget to store the now known valid token + if !auth.IdExist(repo, cred.ID()) { + err = auth.Store(repo, cred) + if err != nil { + return nil, err + } + } + err = core.FinishConfig(repo, metaKeyJiraLogin, login) if err != nil { return nil, err @@ -171,10 +179,12 @@ func promptCredOptions(repo repository.RepoConfig, login, baseUrl string) (auth. } lp := auth.NewLoginPassword(target, login, password) lp.SetMetadata(auth.MetaKeyLogin, login) + lp.SetMetadata(auth.MetaKeyBaseURL, baseUrl) return lp, nil case index == 1: l := auth.NewLogin(target, login) l.SetMetadata(auth.MetaKeyLogin, login) + l.SetMetadata(auth.MetaKeyBaseURL, baseUrl) return l, nil default: panic("missed case") |