As I understand it, the creation of these two accounts is related to email, if the email matches the emails on social networks, then everything is probably fine. However, the problem arises when the vint.ee user's email is different from the ones on social networks, but no feedback is given! It seems that the system receives a response from, for example, Facebook, but what is done with this information, it remains confusing, is a new user object created? Anyway, it fails and nothing happens. When I logged out, I tried to log in with the account with the different email, but I get the response that your account is blocked (actually it is). I don't know how the matter is technically solved, but personally I would make a One-To-Many-Relationship, for example, between the classes User(id, username, email, etc) and Connection(id, provider_id, provider_name, user_id(foreign.key(user.id)). For example, the relationship of the user class: class User: connections = relationship("Connection", backref="user") which allows you to match a bunch of these "Connection" objects to one specific user. One option would be to make a query that checks the hashed provider_ids (I dunno, does it need to be hashed??) if the provider_id exists, then everything is OK. Otherwise, you have to create a new object that we associate with the user. In the case of a logged-in user, then the user object exists and there are no problems getting it. If the user is not logged in and WE DO NOT WANT THE OBJECT by EMAIL, then we should probably ask for the username and password using some arbitrary form to match the new Facebook or Google connection there. Why isn't it beautiful? google_provider_id and facebook_provider_id are put directly as records in a table, not as a relationship, then this mess arises that we specify it and it would be fixed from the start, when adding a new account we would simply overwrite the old one. Apparently the email is Unique as a record, which is also logical. Hence the current problem. PS: I have not yet investigated exactly how these providers are, whether they want a specific email so that they are all related to each other, or the solution I described is suitable. PPS: my thoughts may be wrong, based on the above :)
Google/Facebook integration
66 kullanıcı tarafından okundu
To clarify: I linked my Google and Facebook accounts to my profile, then tried to log in with these two accounts, and in both cases my account was blocked.
[i]posted by 30Seconds[/i] The problem arises when the vint.ee user's email is different from the ones in social networks, but no feedback is given! It seems that the system receives a response from, for example, Facebook, but what is done with this information, it remains confusing, is a new user object created?
Actually, it's simple: 1) You have a username x in Vint, which you created once and entered [email protected] as the email address 2) You have a Facebook/Google account, where you use the email address [email protected] 3) You log in to Vint with user X, go to the change details page and click "link your account...". After that, Facebook/Google sends your email ([email protected]). We update the email address of user X ([email protected]) and the next time you log in to Vint via Google/Facebook, you will be logged in as user X. A conflict may occur if you already had another account in Vint with the e-mail address [email protected]. We can only resolve such a conflict manually in the database. Please send me an email with which FB / Google email address you would like to use with which Vint account.
In Postgressql (I don't remember anymore) you could put some kind of "label" on the fields that you don't want to use, but these records would still be in the database. As I understand it, during this Merge, my old account was updated, which is closed? Then why can't you create a new user with the old email if the old user is closed? I apologize for trolling :D :D, since I do something similar myself, it's probably good to avoid certain mistakes
[i]posted by 30Seconds[/i] Then why can't you create a new user with an old email if the old user is closed?
Because if the old user is closed because of scoundrels, there's no need to make life easy for people and allow them to open a new account with the same email. What are you building? Maybe we'll join forces :)? The Vint.ee owners/developers' group has already dried up.
I also write for the web and use the Python framework: http://flask.pocoo.org/ Since May and June are quite busy times with both school and work, but after that we could join forces. The website should go live by the end of this month, it's actually up in the test environment at the moment, but I don't think I'm allowed to share it yet, at least publicly, privately I can send pictures of the page and its design (made according to the draft) if there's any interest.