Facebook Login does not work when visiting a K2 page.

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Sun Jul 21, 2013 6:09 pm
Reply with quote
Report this post
Hello,

I updated to the latest version of K2, and the fb login quit working. The login works on other areas of my site. It only quits working when you visit an area of the site that has been created by, or has information that originates from K2. I have disabled all of the social logins for k2 that I know of. Any and all help is very much appreciated.

Thanks,

Tim
User avatar
Junior Boarder

GK User
Mon Jul 22, 2013 9:08 pm
Reply with quote
Report this post
Hi,

Could you provide me an URL to your website with this problem?
User avatar
Administrator

GK User
Thu Jul 25, 2013 5:00 am
Reply with quote
Report this post
dziudek wrote:Hi,

Could you provide me an URL to your website with this problem?


www.8ballsmusic.com
User avatar
Junior Boarder

GK User
Thu Jul 25, 2013 9:57 am
Reply with quote
Report this post
Please open file layouts/blocks/social.php and 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(document.id('login-form')){
                  document.id('modlgn-username').set('value','Facebook');
                  document.id('modlgn-passwd').set('value','Facebook');
                  document.id('login-form').submit();
               } else if(document.id('com-login-form')) {
                  document.id('username').set('value','Facebook');
                  document.id('password').set('value','Facebook');
                  document.id('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(document.id('login-form')){
                        document.id('modlgn-username').set('value','Facebook');
                        document.id('modlgn-passwd').set('value','Facebook');
                        document.id('login-form').submit();
                     } else if(document.id('com-login-form')) {
                        document.id('username').set('value','Facebook');
                        document.id('password').set('value','Facebook');
                        document.id('com-login-form').submit();
                     }
                 } else {
                   //user cancelled login or did not grant authorization
                 }
               }, {scope:'email'});     
               }
User avatar
Administrator

GK User
Thu Jul 25, 2013 12:32 pm
Reply with quote
Report this post
Totally fixed it! Thank you so much! :D
User avatar
Junior Boarder


cron