Topic-icon Automatic registration and JSPT

Active Subscriptions:

None
8 years 10 months ago #62192 by AppsProyectos
Hi,

We have setup a website with Jomsocial, JFBConnect and JSPT. The registration flow is managed by jomsocial and JSPT is managing our user's profile types (wich are three). Each time a user sign-up it first must select a profile type and then an identification type (credentials or social account). This process works fine if the user goes to our registration page and follow the registration steps as told. But if the user goes to any of our login forms in where social login buttons (provided by jfbc) are available and clicks on any of them (facebook or google +) without having an account yet, two things could happens.

- If we have automatic registration enabled, there is no promp for profile type selection and a new account with the DEFAULT profile is created for the user (using the social account that he/she selected before).

- If we HAVE NOT automatic registration enabled, as because the user has not an account yet is redirected to jomsocial registration page (which is the seo url of jomsocial registration and not our menu item's url for registration). Once on that registration page the user selects a profile type and then chose (again) a sign-in method. If he/she choose a social media account it is redirected again to the registration page, entering in an annoying loop. This is probably because the f*** chrome's cache for redirections (btw, is making me crazy with this!)

So, resuming. What we are looking for is that when a user hasn't an account and click on social button on login forms, it must be redirected to registration page (properly JRouted with menu item id).

I hope explain this well with my idiomatics limitations.

Regards,
JM Diaz
The topic has been locked.
Support Specialist
8 years 10 months ago #62197 by alzander
The Social Profiles - JomSocial plugin should be redirecting the user to the first step in the registration process, which usually doesn't have the social login buttons on it. The plugin sets the registration URL to:
index.php?option=com_community&view=register
You can edit the /plugins/socialprofiles/jomsocial/jomsocial.php file around line 41 to have whatever URL the user should go to there. However, it should be of the format above, only adding additional parameters, like an Itemid=xxx to it. Otherwise, other parts of the registration process to pre-fill fields may not work.

I hope that helps explain, but if you need anything else, just let me know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 10 months ago #62200 by AppsProyectos
Hi Alex!

I added Itemid to url and now it is redirecting to the correct page, but still entering in a loop. You could check it on my site:

- Go to "Comunidad"
- Click on Facebook or Google button on login form
- You will be redirected to our registration page. (Everything fine upto here)
- Select a profile type
- Select (again) a social account.
- You will be redirected to same page without any message.

www.todoboda.com

Regards,
JM
The topic has been locked.
Active Subscriptions:

None
8 years 10 months ago #62201 by AppsProyectos
Alex,

I made some testing again and this only happends with social sign-up... If i choose to sign-up with an email and a password, everything works fine.

Regards,
JM
The topic has been locked.
Active Subscriptions:

None
8 years 10 months ago #62203 by AppsProyectos
Alex, i found why the loop.

When i click Facebook or Google + buttons, in some point of the triggered flow, it calls to login method on login controllers (of jfbconnect component). That method (you should know this, but just in case) gets the provider, gets account information from the provider, checks if the user is logged, or if exists and does a couple of things depending on the user condition, at the end a comment says:

// At this point, we have nothing left to do but redirect the user to the registration page

The next steps is set some user states on application object and then redirect to proper registration page according to selected registratation component.

What happens is that in registration page, when the user clicks again on Facebook or Google + button, this method login on login controller is called again, resulting on a redirection to registration page instead of creating a new user, mapping it with facebook or google account and continue the registration flow.

Any workaround or fix for this??? We need something asap.

Regards,
JM
The topic has been locked.
Support Specialist
8 years 10 months ago #62215 by alzander
JM,
Sorry for the delay. I just tried on your site and after using the Facebook login page was brought directly back to the comunidad page with the following message:

Mensaje
Perfil de Facebook conectado con éxito.

I didn't see the profile selection at all, so I couldn't directly test.

With that said however, the social login buttons should just not be enabled on that page, it sounds like. The user shouldn't hit Facebook login -> Select a profile -> hit Facebook Login again. If they do, they are choosing to start the process over.

I'd remove the buttons from that profile selection page so that it's not an option at that point and they can proceed as normal. Again, I couldn't test, but hopefully that is possible.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 10 months ago - 8 years 10 months ago #62217 by AppsProyectos
Alex, i saw your registration done.

What happend was that i had automatic registration enabled for a couple of hours for testing, and that is when you sign up.

How can i detect if the registration process is in course? I saw a cookie set to 1, or there is some session value that i can use to avoid showing login buttons and credentials form if the user touch in login buttons?

Regards,

JM
Last edit: 8 years 10 months ago by AppsProyectos.
The topic has been locked.
Active Subscriptions:

None
8 years 10 months ago #62220 by AppsProyectos
Alex, i setup everything again for testing. I will remove your account so you can check it again.

Please, let me know if you can sign-up now.

I need to know the proper way to continue the registration process when a user click on facebook or google buttons in a login form and the selects a user's profile.

Regards,
JM
The topic has been locked.
Active Subscriptions:

None
8 years 10 months ago #62222 by AppsProyectos
Alex, i replace this lines:
            // Check if no mapping, and Automatic Registration is set. If so, auto-create the new user.
            if (!$jUserId && JFBCFactory::config()->getSetting('automatic_registration') )

with this ones:
  $session = JFactory::getSession();
            // Check if no mapping, and Automatic Registration is set. If so, auto-create the new user.
            if (!$jUserId && JFBCFactory::config()->getSetting('automatic_registration') || (($app->getUserState('com_jfbconnect.registration.alternateflow') && $session->get('SELECTED_PROFILETYPE_ID',0,'XIPT')!=0)) )

That change breaks the loop when the user selects the profiletype on XIPT (JSPT), i dont know if this is a possible change on your extension, but that solves my problem (i think hehe)

Regards,
JM
The topic has been locked.
Support Specialist
8 years 10 months ago #62226 by alzander
JM,
I'm confused how the change above fixes things because that block of code is *only* for automatic registration. Why are you trying to send the user down that path and, if so, why not just enable automatic registration to begin with?

Just trying to get a handle on the fix, but glad you found something that seems to work for you.

Thanks,
Alex
The topic has been locked.