Comments (11)
@tedmiston Have you checked your database to see if the proper fields were set? You may also want to set nullable=False
on the user_id
field of the Connection
class and see if any issues arise when a user authorizes a connection with Facebook.
from flask-social.
@mattupstate In the connection
table,
- these fields are set:
id
,user_id
,provider_id
,access_token
,display_name
,profile_url
,image_url
- and these fields are null:
secret
,rank
In the user
table:
- set:
id
,email
,password
,active
- null:
confirmed_at
The initial authorization appears to be happening properly to make this database row and on Facebook to give the permissions, but the error occurs when I click the Login with Facebook
button while not logged for a Facebook account that's already authorized.
(I've also tried clearing the app permissions on Facebook and following the same steps to ensure I can reproduce it.)
Edit: Also, I don't think it should matter, but I'm currently using SQLite behind SQLAlchemy.
from flask-social.
You'll want to create a SQLAlchemy Relationship to connect the Connection
and the User
. This will produce a Connection.user_id
and automagically created a Connection.user
reference that looks up the user from the user_id.
from flask-social.
Oh right, do you have user = db.relationship('User')
on the Connection
class? Is that missing from the docs?
from flask-social.
Just looked. It has user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
on the Connection
. We should update that.
from flask-social.
I can do that, I'll ping you @mattupstate when it's up so you can refresh the pythonhosted.org page.
from flask-social.
@mattupstate So I do not have that on the connection class (and it is not in the docs at https://pythonhosted.org/Flask-Social/).
I took a minute to download the old flask-social-example, and saw this line that wasn't in the docs:
class User(db.Model, UserMixin):
...
connections = db.relationship('Connection',
backref=db.backref('user', lazy='joined'), cascade="all")
Adding this appears to fix the error on my end. Is this equivalent to what you suggested?
from flask-social.
Yep, that will work as well.
from flask-social.
@mattupstate updated on master
and merged into develop
.
from flask-social.
Awesome. Thanks for the quick responses!
Edit: I guess shouldn't close this so abruptly in case you guys would like to add any additional comments.
from flask-social.
it's work. thanks a lot
from flask-social.
Related Issues (20)
- Unique Oauth connections for users HOT 7
- Way to override provider? Possible? HOT 1
- POST_OAUTH_LOGIN_SESSION_KEY is never used
- deprecated Flask-OAuth, use Flask-OAuthlib HOT 4
- Google provider HOT 4
- Demo does not work as intended HOT 5
- Minimalist Example HOT 1
- Improper Redirect HOT 1
- Facebook OAuth redirect not completing HOT 2
- SOCIAL_FLASH_MESSAGES config does not work HOT 1
- Example config for Configuration values HOT 1
- Can Flask-social be used for LinkedIn? HOT 1
- get_api method hard coded to current_user
- Python 3.x support HOT 4
- Flask factory pattern support HOT 2
- calling iteritems causes an exception on Python 3 HOT 2
- Registration HOT 2
- is this project still maintained? HOT 3
- Broken travis build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-social.