Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Gravatar #37

Merged
merged 5 commits into from
May 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove avatar_url on OAuth unlink
  • Loading branch information
thomiceli committed May 24, 2023
commit 5bd0206c622eadda11aad29bf6fd59695cacf512
10 changes: 8 additions & 2 deletions internal/models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,15 @@ func (user *User) HasLiked(gist *Gist) (bool, error) {
func (user *User) DeleteProviderID(provider string) error {
switch provider {
case "github":
return db.Model(&user).Update("github_id", nil).Error
return db.Model(&user).
Update("github_id", nil).
Update("avatar_url", nil).
Error
case "gitea":
return db.Model(&user).Update("gitea_id", nil).Error
return db.Model(&user).
Update("gitea_id", nil).
Update("avatar_url", nil).
Error
}

return nil
Expand Down