mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 09:09:02 +00:00
4 line diff (#13103)
This commit is contained in:
parent
64133126cd
commit
845d0afb33
|
@ -74,9 +74,7 @@ type GitlabDownloader struct {
|
||||||
// Use either a username/password, personal token entered into the username field, or anonymous/public access
|
// Use either a username/password, personal token entered into the username field, or anonymous/public access
|
||||||
// Note: Public access only allows very basic access
|
// Note: Public access only allows very basic access
|
||||||
func NewGitlabDownloader(ctx context.Context, baseURL, repoPath, username, password, token string) (*GitlabDownloader, error) {
|
func NewGitlabDownloader(ctx context.Context, baseURL, repoPath, username, password, token string) (*GitlabDownloader, error) {
|
||||||
var gitlabClient *gitlab.Client
|
gitlabClient, err := gitlab.NewClient(token, gitlab.WithBaseURL(baseURL))
|
||||||
var err error
|
|
||||||
gitlabClient, err = gitlab.NewClient(token, gitlab.WithBaseURL(baseURL))
|
|
||||||
// Only use basic auth if token is blank and password is NOT
|
// Only use basic auth if token is blank and password is NOT
|
||||||
// Basic auth will fail with empty strings, but empty token will allow anonymous public API usage
|
// Basic auth will fail with empty strings, but empty token will allow anonymous public API usage
|
||||||
if token == "" && password != "" {
|
if token == "" && password != "" {
|
||||||
|
|
Loading…
Reference in a new issue