mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 08:56:29 +00:00
modify for gitlab avatar settings by relative and non-relative path
This commit is contained in:
parent
5e6db73d4a
commit
c405118b8a
1 changed files with 6 additions and 1 deletions
|
@ -73,7 +73,12 @@ func (r *Gitlab) Login(token, secret string) (*common.User, error) {
|
||||||
user.Email = login.Email
|
user.Email = login.Email
|
||||||
user.Token = token
|
user.Token = token
|
||||||
user.Secret = secret
|
user.Secret = secret
|
||||||
user.Avatar = r.URL + "/" + login.AvatarUrl
|
|
||||||
|
if strings.HasPrefix(login.AvatarUrl, "http") {
|
||||||
|
user.Avatar = login.AvatarUrl
|
||||||
|
} else {
|
||||||
|
user.Avatar = r.URL + "/" + login.AvatarUrl
|
||||||
|
}
|
||||||
return &user, nil
|
return &user, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue