• Resolved auther61

    (@auther61)


    Hi,

    I’m using the nsl_registration_user_data filter to prevent Google authentication user registrations in some cases. It works great, and whenever I do that, I redirect the user to an error page which allows him to register/login again.

    The problem is that whenever I do that, when the user click the Google authentication link again, he automatically just sees the error again (as he’s already “authenticated” to Google).
    Is there an option to revoke the “token” that is saved by Google and allow the user to select a different account?

    The flow is:
    1. user enters our login screen
    2. the user clicks google authentication and selects an account
    3. we decide not to allow registration and redirect to an error page
    4. the user tries to authenticate (register/login) with a different user, which we should allow
    5. At this point, I would like the list of google users to show up again. Instead, the authentication logic happens behind the scenes and he sees the error again for the previous account he already chose.

    What can be done to allow the user to switch accounts?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Ramona

    (@nextend_ramona)

    Hi @auther61

    Can you try putting the following code:
    $this->provider->deleteLoginPersistentData();
    to \wp-content\plugins\nextend-facebook-connect\includes\userData.php
    around line 69 you’ll fine this code:

    if ($this->errors->get_error_code() != '') {
        if ($this->errors->get_error_message() != '') {
            \NSL\Notices::addError($this->errors->get_error_message());
        }
    
        wp_redirect( site_url( 'wp-login.php' ) );
        exit();
    }

    And the $this->provider->deleteLoginPersistentData(); shuld be added after the first if, like this:

    if ($this->errors->get_error_code() != '') {
        $this->provider->deleteLoginPersistentData();
        if ($this->errors->get_error_message() != '') {
            \NSL\Notices::addError($this->errors->get_error_message());
        }
    
        wp_redirect( site_url( 'wp-login.php' ) );
        exit();
    }

    It seemed to work fine for me during a quick test. I’ll need to check in with out developer (he’s outside the office for the week) and if he confirms that this seems alright, we’ll put it to the next version.

    Thread Starter auther61

    (@auther61)

    That worked great, thank you so much, I appreciate the help!

    Plugin Support Laszlo

    (@laszloszalvak)

    Hi @auther61

    We will include this code part to Nextend Social Login, too.
    So don’t worry you won’t lose these modifications once we release a new version!

    Best regards,
    Laszlo.

    Thread Starter auther61

    (@auther61)

    @laszloszalvak, that’s great, thank you!
    You’re providing an amazing support for this plugin, it’s very much appreciated!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Allow a user to change an account’ is closed to new replies.