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

Disable Gravatar #37

merged 5 commits into from
May 26, 2023

Conversation

thomiceli
Copy link
Owner

  • If user is using an OAuth provider, use this avatar url, else
  • If Gravatar is enabled and user has set an email, use Gravatar url, else
  • Use default avatar

@thomiceli thomiceli linked an issue May 18, 2023 that may be closed by this pull request
@thomiceli
Copy link
Owner Author

@josefandersson thoughts ?

Copy link
Contributor

@josefandersson josefandersson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great man. I completely forgot this myself so it's awesome that you picked it up... 😅 I really only had some nitpicks, do as you please!

userMap := make(map[string]*User)

err := db.
Where("email IN ?", emails).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are emails normalized in db or will this create issues with capitalization? A normalizedEmail field in db may be good otherwise? For this use-case and when looking up by email in the future.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right it might create issues ; the current email field in db should contain only lowercase emails, and the fetched emails in commits would be set as lowercase.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. I also think it's best to save the original email also, and not just a normalized one--hence why I would recommend a normalizedEmail field rather than normalizing the current email field. Emails can technically be case sensitive and it could technically screw with future email notification/sending functionality if the original is not kept.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your way of doing it makes good enough sense for the scale of this project. Same with not bothering to care about migrating old emails in db to lowercase. Maybe in a few years it's a different story. :)

internal/web/auth.go Outdated Show resolved Hide resolved
internal/git/output_parser.go Outdated Show resolved Hide resolved
internal/web/gist.go Outdated Show resolved Hide resolved
Copy link
Contributor

@josefandersson josefandersson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff man!

@thomiceli thomiceli merged commit 4a75a50 into master May 26, 2023
4 checks passed
@thomiceli thomiceli deleted the feature/disable-gravatar branch June 1, 2023 17:04
jiriks74 pushed a commit to jiriks74/opengist that referenced this pull request Apr 28, 2024
* Disable Gravatar
* Lowercase emails
* Add migration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to disable Gravatar
2 participants