Add proxying gravatar requests for user avatars (#148)
Fix getting avatar based on email Remove avatarUrl from user struct Fix staticcheck Add default avatar size Add config option for caching avatars go mod vendor Add swagger docs Add proxying gravatar requests for user avatars Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/api/pulls/148
This commit is contained in:
@ -49,8 +49,6 @@ type User struct {
|
||||
// The user's email address.
|
||||
Email string `xorm:"varchar(250) null" json:"email,omitempty" valid:"email,length(0|250)" maxLength:"250"`
|
||||
IsActive bool `xorm:"null" json:"-"`
|
||||
// The users md5-hashed email address, used to get the avatar from gravatar and the likes.
|
||||
AvatarURL string `xorm:"-" json:"avatarUrl"`
|
||||
|
||||
PasswordResetToken string `xorm:"varchar(450) null" json:"-"`
|
||||
EmailConfirmToken string `xorm:"varchar(450) null" json:"-"`
|
||||
@ -63,11 +61,6 @@ type User struct {
|
||||
web.Auth `xorm:"-" json:"-"`
|
||||
}
|
||||
|
||||
// AfterLoad is used to delete all emails to not have them leaked to the user
|
||||
func (u *User) AfterLoad() {
|
||||
u.AvatarURL = utils.Md5String(u.Email)
|
||||
}
|
||||
|
||||
// GetID implements the Auth interface
|
||||
func (u *User) GetID() int64 {
|
||||
return u.ID
|
||||
|
Reference in New Issue
Block a user