Osclass forums

Support forums => Plugins => Facebook Connect => Topic started by: Dannad_ on August 31, 2016, 04:20:26 am

Title: facebook connect fail to complete
Post by: Dannad_ on August 31, 2016, 04:20:26 am
I installed the facebook connect plugin, also created the facebook app and enter the app id and secret code in osclass admin.

I got this message. "Congratulations. The plugin is now configured"

than... I added this code to my header.php file.

Code: [Select]
<?php fbc_button(); ?>

Now... I can see the "Login with Facebook" link on the login page (that I changed to an image button).

when I click in that button, i´m not logged in yet. so at this point i need to enter the facebook login details (username and password).

The issue is after I enter the details and click login button, nothing happens.

It not fill any data in user account or users db. and I still need to login to the site.

But if i try to enter on facebook´s page... is already connected...

So... the login is working. nothing but that.

and i tryed to redirect to user dashboard using the following post:

http://forums.osclass.org/plugins/redirect-to-'url'-after-login-with-facebook/msg122038/#msg122038

***************************************************
On line 91 you see this code
Code: [Select]
return self::$facebook;
     Move this line down using enter key and place this code
Code: [Select]
header( 'Location: ' . osc_user_profile_url() );
on line 91
     Saven & Close this file

Now, open the index.php file in the plugin folder.
The plugin is setup in such a way that the init function is loaded with every page load, this is not needed and since we want a working relocation we will add an if statement.

Replace the function called 'fbc_init()' with this function:
Code: [Select]
    function fbc_init() {
      //Let's check if we're on login page, if not no need for init
      if(osc_is_login_form()) {
         $facebook = OSCFacebook::newInstance()->init();
      }
    }

It works for me, let me know if you run into issues.
****************************************

but nothing happens at all

tnkx
Title: Re: facebook connect fail to complete
Post by: auth on September 26, 2016, 04:29:07 pm
Take a look here: http://forums.osclass.org/facebook-connect/csrf-state-token-does-not-match-one-provided/msg118904/#msg118904