Coder Social home page Coder Social logo

Comments (5)

josefandersson avatar josefandersson commented on May 25, 2024 1

I was thinking that both Gravatar and OAuth Avatar could be enabled at the same time and that we practically just do

var avatarUrl =
    (OAuthAvatar.Enabled ? OAuthAvatarUrl : null)
        ?? (Gravatar.Enabled ? GravatarAvatarUrl : null)
        ?? MissingProfile.png

does that make sense?

The extra query is a valid concern. But it shouldn't have too big of an impact though? (Albeit we are using SQLite atm... :P) I will see if I have the time to experiment with this feature tonight if you're not already on it. :)

from opengist.

thomiceli avatar thomiceli commented on May 25, 2024

Hi, thanks for the thoughts!

I'm not into uploading and storing pictures via Opengist.. but instead having an url pointing to an image.
It would be ok to have an option to disable gravatar, either in the config.yml or via the admin panel.

So, i would say : either you use Gravatar (if enabled) with your email or enter an url to your picture; and if you're logged in with OAuth we can set the url to the picture according to the provider (https://avatars.githubusercontent.com/u/:github_userid or https://gitea.com/api/v1/users/:gitea_username)

What do you think ?

from opengist.

josefandersson avatar josefandersson commented on May 25, 2024

I get why you're against hosting the images! Saving the url to their oauth provider avatar sounds good enough to me (and don't we already get that data from goth when authenticating?).

Do you mean allowing the user to set their own url? That sounds like a privacy risk to me...

I'm thinking that this is good enough for the time being:

  • "Use Gravatar" option
  • "Use avatar from OAuth provider" option

And fallback to an anonymous profile.png otherwise.

What should be stored in db? A single avatar_url string which will be updated on every OAuth authentication?

from opengist.

thomiceli avatar thomiceli commented on May 25, 2024

Your idea of avatar_url sounds good.

I can see in the user settings radio buttons to either choose to display the avatar from Gravatar or from the OAuth provider (if both options are enabled of course)

Anyway one hitch about this whole feature would be in the revisions list, where you can have multiple users who have committed : right now getting the avatar from Gravatar is based on the git committer email address, but now it would actually need one more database query instead to get avatar urls

from opengist.

thomiceli avatar thomiceli commented on May 25, 2024

I would have replaced nulls with MissingProfile.png; also with your logic there you cant use your Gravatar pic if you log in with an OAuth provider, but it's actually fine by me since i want to keep this simple for now :)

If you have some spare time to implement this, i would be glad to see your contribution :)

from opengist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.