• Resolved John Kleinschmidt

    (@johnkleinschmidt)


    Otto,

    I noticed an issue with the latest (1.1) when logging out under unusual circumstances.
    The scenario:
    1) I was logged into my WP site with user “A”. User “A” had been logged in using FB connect.
    2) I wanted to test a test FB user, so I went over to FB’s developer site and switched to a test FB user that wasn’t registered for my site.
    3) I then attempted to logout of my WP site and got an FB js error (FB.logout() called without an access token.)

    I know this is a strange situation that may not happen in real life, but I found that if you check for FB.getAuthResponse() before FB.logout, it avoids this issue. Anyway, if its useful, here’s the patch from my fix:

    Index: sfc-login.php
    ===================================================================
    --- sfc-login.php       (revision 444964)
    +++ sfc-login.php       (working copy)
    @@ -196,9 +196,13 @@
     function sfc_login_logout_js() {
            $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?loggedout=true';
     ?>
    +if (FB.getAuthResponse()) {
     FB.logout(function(response) {
            window.location.href = '<?php echo $redirect_to; ?>';
     });
    +} else {
    +       window.location.href = '<?php echo $redirect_to; ?>';
    +}
     <?php
     }

    http://wordpress.org/extend/plugins/simple-facebook-connect/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Simple Facebook Connect] Logout issue with patch’ is closed to new replies.