modify for gitlab avatar settings by relative and non-relative path

This commit is contained in:
letusfly85 2015-08-10 16:15:33 +09:00
parent 5e6db73d4a
commit c405118b8a

View file

@ -73,7 +73,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
}