forked from NYANDEV/forgejo
Backport Migration Option AuthToken (#13101)
fix #13085 Backport #12862 Backport Parts of #12672
This commit is contained in:
parent
d4af0df967
commit
f9942add50
8 changed files with 37 additions and 33 deletions
|
@ -36,6 +36,12 @@ func MigrateRepository(ctx context.Context, doer *models.User, ownerName string,
|
|||
theFactory base.DownloaderFactory
|
||||
)
|
||||
|
||||
// determine if user is token
|
||||
if len(opts.AuthUsername) != 0 && len(opts.AuthPassword) == 0 {
|
||||
opts.AuthToken = opts.AuthUsername
|
||||
opts.AuthUsername = ""
|
||||
}
|
||||
|
||||
for _, factory := range factories {
|
||||
if match, err := factory.Match(opts); err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue