This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 104
Social log in only #27
Comments
Hey @rjbriody. This is doable without too much extra work using the @login_failed.connect_via(app):
def on_login_failed(sender, provider, oauth_response):
connection_values = get_connection_values_from_oauth_response(provider, oauth_response)
ds = current_app.security.datastore
user = ds.create_user( ... ) #fill in relevant stuff here
ds.commit()
connection_values['user_id'] = user.id
connect_handler(connection_values, provider)
login_user(user)
db.commit()
return render_template('success.html') As for filling in the relevant stuff for creating the user, I just create a random string for the password, and haven't had issues leaving the email null. Hope that helps! |
Hey this is way better than the ugly hack I made. I'm excited to try it out. Thanks! |
Great, glad to see more people using Flask-Social! |
👍 |
@rjbriody @eriktaubeneck Just wondering if you guys wrote a tutorial somewhere about how to do this (a small complete application). Would be a nice tutorial for beginners like me. :) |
This really should be in the docs! |
Open
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It would be awesome if it were possible to log in w/ a social account only. Meaning there would be no need to enter email or passwords.
Apparently others are looking for this as well (I did not create this stack post): http://stackoverflow.com/questions/17998627/using-flask-social-with-oauth-providers-only-no-local-registration-login-form
The text was updated successfully, but these errors were encountered: