pallets-eco/flask-social

Way to override provider? Possible?

Closed this issue · 1 comments

I am using mongo and I don't have the exact same fields as the dict in the facebook plugin:
full_name = profile.get('name', None),
I actually have 'name' and not 'full_name'.

Can I provide my own facebook.py somehow? I could not work out how.
Maybe it's easy. This code from core.py is close but it adds the module path.

        default_module_name = 'flask_social.providers.%s' % suffix
        module_name = config.get('module', default_module_name)
        module = import_module(module_name)

(I could also monkeypatch get_connection_values and put my own facebook to mongo decoder. Not approved. )

You closed this, so I'm guessing you figured it out, but the general pattern with Flask-Social (using Mongo or any other data store) would be to match the fields in the existing fields within the providers. All of the providers have the same fields so that the Connection class can abstract the connection to any provider.