Topic-icon Automatically Link Users by Email Not Working

10 years 7 months ago #36324 by chramb1
I have this option (Automatically Link Users by Email) turned on.

I have a new site from which I imported all of my users from my old site and then installed the FBConnect component. So there are over 2000 existing user accounts. I have the normal registration mode turned on (not automatic) such that when a new user comes along and logs in with Facebook, s/he is presented with the normal registration as well so I can capture more information. This all works.

But when an EXISTING user comes along and clicks on the Facebook button, I expect this option (Automatically Link Users by Email) to say, "Hey, look, Facebook authenticated this guy and his email is already in my users database. Don't bother him, just make the association and log him in, he's good to go!"

It does not do that.

It, instead, presents my user with a screen to log in OR register. The URL it sends them to is www.rockyhorror.org/component/jfbconnect...facebook&return=Lw==

This isn't the behavior I would expect. What's up?
The topic has been locked.
10 years 7 months ago #36325 by chramb1
It gets worse.

On that page, I chose to log in. I logged in as a user with a DIFFERENT EMAIL ADDRESS than the one associated with the Facebook account I used to start the process.

It was happy to make the association and import the fields. So now I have a Joomla account with one email address that is NOT the email address associated with its Facebook mapping.

Not good.
The topic has been locked.
10 years 7 months ago #36326 by chramb1
Also, after logging in and having it make the mapping it DID NOT import fields into JomSocial and Kunena has I have configured. I have it set to only import the first time, on registration.

My guess is that it's not considering this mapping to an existing account to be a "first time," and I believe it should.
The topic has been locked.
Support Specialist
10 years 7 months ago #36394 by alzander

But when an EXISTING user comes along and clicks on the Facebook button, I expect this option (Automatically Link Users by Email) to say, "Hey, look, Facebook authenticated this guy and his email is already in my users database. Don't bother him, just make the association and log him in, he's good to go!"

Yup, that's the proper behavior and should be what happens. That should work with both Facebook and Google.. if the primary email address they have in their social network is the exact same as a Joomla user on your site, they should be automatically mapped.

On that page, I chose to log in. I logged in as a user with a DIFFERENT EMAIL ADDRESS than the one associated with the Facebook account I used to start the process.

It was happy to make the association and import the fields. So now I have a Joomla account with one email address that is NOT the email address associated with its Facebook mapping.

This is normal behavior. If you have the "Email Field on Registration:" setting enabled, the user will be able to enter or edit the email address from Facebook/Google and we will create the account with whatever email they provide.

If you already have the "Email Field on Registration:" setting disabled, the email should be hidden and the Joomla account will be created with their social network address. *However*, if that email address is already detected with a Joomla user, JFBConnect will *always* show the Email field and blank it out completely. That should never happen if you have the "Automatically link by email" setting enabled since they shouldn't get to that page.

So, try the process again with the Automatically like by email" setting enabled and the "Email Field on Registration:" disabled (so it should be hidden) and let me know if instead the email field is shown and blank. That will greatly help narrow down where the problem may be.

Also, after logging in and having it make the mapping it DID NOT import fields into JomSocial and Kunena has I have configured. I have it set to only import the first time, on registration.

My guess is that it's not considering this mapping to an existing account to be a "first time," and I believe it should.

Your correct, it will not import data on a connection, only registration or login. This is something we're investigating a better solution for in the future. Some users absolutely want it how it is, others want it as you want.. so we'll have to have an option at some point. Some admins (and users) would be very annoyed if their avatar, cover photo and all of their profile information was overwritten just because they connected accounts, and we understand that.

As we add more social networks and 'connecting' will be even more common, we'll be addressing scenarios like this even better to allow more flexibility in what happens.

I hope that explains. Let me know about the email field though so we can understand and investigate that more.

Thanks,
Alex
The topic has been locked.
10 years 7 months ago #36404 by chramb1
That makes sense (the mapping of fields on a connection vs. new registration). And yes, I'd like it the way I described, so if you make it an option, I'd use it. So count this as a vote.

I will budget time this week to test the email settings and get you a definitive answer on which settings do what. So I'll be back in this thread shortly - this weekend at the latest (if my schedule stays as busy as it already is :-))
The topic has been locked.
Support Specialist
10 years 7 months ago - 10 years 7 months ago #36425 by alzander
Definitely keep me posted. The main thing is whether that email field is visible on registration and, especially, if it's blank. That will tell us a lot.

I just stared at the code a bit, and am thinking there very easily may be a bug. I'll have to investigate further, but if you want to test something that I'm pretty sure is the 'correct' code, please open the /components/com_jfbconnect/controllers/login.php file Around line 63, you'll see:
if (!$provider->initialRegistration && JFBCFactory::config()->getSetting('facebook_auto_map_by_email') && !$jUserId)
<<DO NOT MAKE THIS CHANGE, IT IS INCORRECT>>
That first check likely shouldn't have the ! when checking for initialRegistration. We want the auto mapping to work on initial registration.. so remove the ! and change that to:
if ($provider->initialRegistration && JFBCFactory::config()->getSetting('facebook_auto_map_by_email') && !$jUserId)
<<DO NOT MAKE THIS CHANGE, IT IS INCORRECT>>
We'll definitely do more testing and, if this change is necessary, get it into the 5.1.2 release due out around mid-September.

Thanks,
Alex
Last edit: 10 years 7 months ago by alzander.
The topic has been locked.
Support Specialist
10 years 7 months ago #36613 by alzander
Christopher,
Just wanted to checkin with you to see if you had investigated this further. We did a bit of testing and cannot recreate this issue. We also use the Auto link by email option on this site, and it's been working fine as best we can tell.

Additionally the code change above should *NOT* be implemented. My quick glance of the code wasn't enough to understand what was going on there, and removing that ! will not fix the issue (and likely cause some other minor things to crop up).

We are working on the v5.1.2 release, and if there is anything we can fix, we gladly will.. but are perplexed as to what's happening on your site.

Thanks,
Alex
The topic has been locked.
10 years 7 months ago #36710 by chramb1
I'm behind. We got hit with a breaking bug in a major component that sidetracked this week. I hope to catch up over the weekend.
The topic has been locked.
Support Specialist
10 years 7 months ago #36718 by alzander
No problem.. just looking for feedback, but not trying to rush you. I hope the 'major component' wasn't us!

Best wishes,
Alex
The topic has been locked.
10 years 7 months ago #36866 by chramb1
Nope, not you ;) Just a note that this hasn't been dropped and I should be able to test it out in the next couple days.

The good news is we're down to just a few bugs in the backlog, which is flat-out astounding!
The topic has been locked.