Facebook log in works partially

Premium sports magazine Joomla template with clean, easy to customize and unique design.
GK User
Thu Jan 10, 2013 12:38 pm
I've tried trawling through a lot of the forum posts looking for an answer but couldn't find anything to fix my problem. I've followed the steps in this guide: http://www.gavick.com/documentation/joo ... k-feature/

Logging in with facebook brings up a new window and the app asks for permission but after successfully logging in the website does nothing. I am not redirected anywhere and the same log in pop up is still on my screen. I've checked the ID and secret multiple times and they are correct in both the Social API and the actual plug in.

Website: www.salibandits.com

Image
User avatar
Fresh Boarder

GK User
Wed Jan 16, 2013 11:16 am
Hi,

For me you have some jQuery without jQuery.noConflict() what cause that function $ used in our scripts doesn't work properly.
User avatar
Administrator

GK User
Thu Jan 17, 2013 8:14 pm
Thanks for the reply! For simplicity I've decided not to use the facebook login for the moment. I'll bear that in mind if I decided to reactivate it in the future. :)
User avatar
Fresh Boarder

GK User
Sun Mar 10, 2013 10:11 am
Can you expand on the jquery comment?
I cannot get Facebook login to work on gk_simplicity either
When you try to login the facebook dialog appears. After you try to login nothing appears to happen. The Joomla site is still not logged in (if you go to facebook, it has logged you into that).
Any ideas?
User avatar
Fresh Boarder

GK User
Mon Mar 11, 2013 8:50 am
@mcorderoy - please provide me an URL to your website.
User avatar
Administrator

GK User
Mon Mar 11, 2013 3:03 pm
dziudek wrote:@mcorderoy - please provide me an URL to your website.


Site is work in progress www.contentpla.net
User avatar
Fresh Boarder

GK User
Mon Mar 11, 2013 6:07 pm
In the layouts/blocks/social.php file please change fragment:

Code: Select all
if(button) {   
             if (response.authResponse) {
               // user is already logged in and connected
            button.onclick = function() {
               if($('login-form')){
                  $('modlgn-username').set('value','Facebook');
                  $('modlgn-passwd').set('value','Facebook');
                  $('login-form').submit();
               } else if($('com-login-form')) {
                  $('username').set('value','Facebook');
                  $('password').set('value','Facebook');
                  $('com-login-form').submit();
               }
            }
         } else {
               //user is not connected to your app or logged out
               button.onclick = function() {
               FB.login(function(response) {
                  if (response.authResponse) {
                     if($('login-form')){
                        $('modlgn-username').set('value','Facebook');
                        $('modlgn-passwd').set('value','Facebook');
                        $('login-form').submit();
                     } else if($('com-login-form')) {
                        $('username').set('value','Facebook');
                        $('password').set('value','Facebook');
                        $('com-login-form').submit();
                     }
                 } else {
                   //user cancelled login or did not grant authorization
                 }
               }, {scope:'email'});     
               }


to:

Code: Select all
if(button) {   
             if (response.authResponse) {
               // user is already logged in and connected
            button.onclick = function() {
               if($('login-form')){
                  $('modlgn-username').set('value','Facebook');
                  $('modlgn-passwd').set('value','Facebook');
                  $('login-form').submit();
               } else if($$('section.login').getElement('form')) {
                        $('username').set('value','Facebook');
                        $('password').set('value','Facebook');
                        $$('section.login').getElement('form').submit();
                    }
            }
         } else {
               //user is not connected to your app or logged out
               button.onclick = function() {
               FB.login(function(response) {
                  if (response.authResponse) {
                     if($('login-form')){
                        $('modlgn-username').set('value','Facebook');
                        $('modlgn-passwd').set('value','Facebook');
                        $('login-form').submit();
                     } else if($$('section.login').getElement('form')) {
                        $('username').set('value','Facebook');
                        $('password').set('value','Facebook');
                        $$('section.login').getElement('form').submit();
                     }
                 } else {
                   //user cancelled login or did not grant authorization
                 }
               }, {scope:'email'});     
               }
User avatar
Administrator

GK User
Mon Mar 11, 2013 6:25 pm
Thanks...
That has improved things, but it is not quite there.
When you click the login with facebook, it now authenticates with facebook, but you still have to click the original login button to actually login.
Is there a way of making it a one click process? (Site is still live if my explanation is not clear)

Once again, thanks for your help
Mark
User avatar
Fresh Boarder

GK User
Tue Mar 12, 2013 11:10 am
Please try to change lines:

Code: Select all
$$('section.login').getElement('form').submit();


to:

Code: Select all
$$('section.login').getElement('form').send();
User avatar
Administrator

GK User
Tue Mar 12, 2013 11:42 am
Thanks, but still not working, I appreciate your help though!
I changed the 2 instances of the code
Code: Select all
   // NEW CODE
      
      if(button) {   
             if (response.authResponse) {
               // user is already logged in and connected
            button.onclick = function() {
               if($('login-form')){
                  $('modlgn-username').set('value','Facebook');
                  $('modlgn-passwd').set('value','Facebook');
                  $('login-form').submit();
               } else if($$('section.login').getElement('form')) {
                        $('username').set('value','Facebook');
                        $('password').set('value','Facebook');
                        //$$('section.login').getElement('form').submit();
                        //New code
                        $$('section.login').getElement('form').send();
                    }
            }
         } else {
               //user is not connected to your app or logged out
               button.onclick = function() {
               FB.login(function(response) {
                  if (response.authResponse) {
                     if($('login-form')){
                        $('modlgn-username').set('value','Facebook');
                        $('modlgn-passwd').set('value','Facebook');
                        $('login-form').submit();
                     } else if($$('section.login').getElement('form')) {
                        $('username').set('value','Facebook');
                        $('password').set('value','Facebook');
                        //$$('section.login').getElement('form').submit();
                        //New code
                        $$('section.login').getElement('form').send();
                     }
                 } else {
                   //user cancelled login or did not grant authorization
                 }
               }, {scope:'email'});     
               }
      
User avatar
Fresh Boarder

GK User
Tue Mar 12, 2013 12:17 pm
Please send me a PM message with the FTP access to your website - then I'll be able to fix it much faster ;)
User avatar
Administrator

GK User
Tue Mar 12, 2013 1:05 pm
PM sent, thanks
User avatar
Fresh Boarder

GK User
Tue Mar 12, 2013 6:25 pm
I've changed the code to the following form:

Code: Select all
if(button) {   
             if (response.authResponse) {
               // user is already logged in and connected
            button.onclick = function() {
               if($('login-form')){
                  $('modlgn-username').set('value','Facebook');
                  $('modlgn-passwd').set('value','Facebook');
                  $('login-form').submit();
               } else if($$('section.login').getElement('form')) {
                        $('username').set('value','Facebook');
                        $('password').set('value','Facebook');
                        $$('section.login').getElement('form')[0].submit();
                    }
            }
         } else {
               //user is not connected to your app or logged out
               button.onclick = function() {
               FB.login(function(response) {
                  if (response.authResponse) {
                     if($('login-form')){
                        $('modlgn-username').set('value','Facebook');
                        $('modlgn-passwd').set('value','Facebook');
                        $('login-form').submit();
                     } else if($$('section.login').getElement('form')) {
                        $('username').set('value','Facebook');
                        $('password').set('value','Facebook');
                        $$('section.login').getElement('form')[0].submit();
                     }
                 } else {
                   //user cancelled login or did not grant authorization
                 }
               }, {scope:'email'});     
          }


And it is working for me fine :)
User avatar
Administrator

GK User
Tue Mar 12, 2013 8:56 pm
Working fine now!
Thank you very much for your help.
User avatar
Fresh Boarder


cron