mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 20:01:02 +00:00
Merge pull request #1123 from letusfly85/0.4-database-gitlab-avatar
add avatar url for gitlab
This commit is contained in:
commit
1a92825799
1 changed files with 6 additions and 0 deletions
|
@ -76,6 +76,12 @@ func (r *Gitlab) Login(token, secret string) (*common.User, error) {
|
|||
user.Email = login.Email
|
||||
user.Token = token
|
||||
user.Secret = secret
|
||||
|
||||
if strings.HasPrefix(login.AvatarUrl, "http") {
|
||||
user.Avatar = login.AvatarUrl
|
||||
} else {
|
||||
user.Avatar = r.URL + "/" + login.AvatarUrl
|
||||
}
|
||||
return &user, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue