Return an avatar for docker id integrations

This commit is contained in:
Jonathan Leibiusky (@xetorthio)
2017-10-17 14:04:14 +02:00
parent 71464cffee
commit 82b95ee112

View File

@@ -164,6 +164,9 @@ func LoginCallback(rw http.ResponseWriter, req *http.Request) {
user.ProviderUserId = userInfo["sub"]
user.Name = userInfo["preferred_username"]
user.Email = userInfo["email"]
// Since DockerID doesn't return a user avatar, we try with twitter through avatars.io
// Worst case we get a generic avatar
user.Avatar = fmt.Sprintf("https://avatars.io/twitter/%s", user.Name)
}
user, err = core.UserLogin(loginRequest, user)