mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-05 10:20:36 +02:00
Merge pull request #1123 from letusfly85/0.4-database-gitlab-avatar
add avatar url for gitlab
This commit is contained in:
commit
1a92825799
@ -76,6 +76,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
|
||||||
|
|
||||||
|
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 New Issue
Block a user