use token auth for https remotes (#275)

use token for https auth instead of user name

also handle http urls

Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/275
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
Norwin
2020-12-07 22:14:56 +08:00
committed by 6543
parent 16133212fc
commit 9a3b54b9a3
3 changed files with 7 additions and 33 deletions

View File

@ -78,7 +78,7 @@ call me again with the --ignore-sha flag`, pr.Head.Ref)
if err != nil {
return err
}
auth, err := local_git.GetAuthForURL(url, login.User, login.SSHKey)
auth, err := local_git.GetAuthForURL(url, login.Token, login.SSHKey)
if err != nil {
return err
}