Skip to content

Commit

Permalink
Return an avatar for docker id integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
xetorthio committed Oct 17, 2017
1 parent 71464cf commit 82b95ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions handlers/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 82b95ee

Please sign in to comment.