Skip to content

Commit

Permalink
fix: generates an avatar even if email is missing (#2594)
Browse files Browse the repository at this point in the history
  • Loading branch information
amir20 authored Dec 14, 2023
1 parent 7306a4e commit 0f3093a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/auth/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ type User struct {
}

func newUser(username, email, name string) User {
avatar := ""
if email != "" {
avatar = fmt.Sprintf("https://gravatar.com/avatar/%s?d=https%%3A%%2F%%2Fui-avatars.com%%2Fapi%%2F/%s/128", hashEmail(email), name)
}
avatar := fmt.Sprintf("https://gravatar.com/avatar/%s?d=https%%3A%%2F%%2Fui-avatars.com%%2Fapi%%2F/%s/128", hashEmail(email), name)

return User{
Username: username,
Email: email,
Expand Down

0 comments on commit 0f3093a

Please sign in to comment.