• Resolved bilalmubdir

    (@bilalmubdir)


    Hi,

    I’m using a function my custom plugin to login via an API. The login process is using wp_signon function with nonce (_wpnonce) and redirection. The issue that when I log in with nonce and JetPack plugin active, the function return 0. When I disabled JetPack, it works perfect and return user data.
    If I logged in without nonce also it works seven if JetPack active.

    I appreciate it in advance if could find the issue to make them both works together.

    Regards

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor James Huff

    (@macmanx)

    What is the URL of the site with the problem, and if WordPress.com Secure Sign On is on https://jetpack.com/support/sso/ does it work with that switched off?

    Thread Starter bilalmubdir

    (@bilalmubdir)

    I’ve disabled Secure Sign on and all JetPack modules but the problem still insist until I deactivate the whole plugin.

    The url is https://www.uruktech.com

    Noting that I’v installed an old version of JetPack and issue solved but the old version in incompatible with many other plugins and services where it cause many issues fo me.

    Plugin Contributor James Huff

    (@macmanx)

    Which version of Jetpack is it working under?

    Thread Starter bilalmubdir

    (@bilalmubdir)

    I tried 6.0 and 7.1 both are OK but they are not compatible with some other plugins.

    Plugin Contributor James Huff

    (@macmanx)

    What versions of WordPress and PHP is your site running?

    Thread Starter bilalmubdir

    (@bilalmubdir)

    WordPress is the latest version, PHP is 7.3.16

    Plugin Support KokkieH

    (@kokkieh)

    I see you still have Jetpack Protect enabled. Does disabling that module make any difference?

    Thread Starter bilalmubdir

    (@bilalmubdir)

    For now the plugin is active because I need it for Woocommerce analytic mobile app.

    Plugin Contributor James Huff

    (@macmanx)

    Don’t disable Jetpack entirely, just the Protect module: https://jetpack.com/support/protect/

    With that disabled, try upgrading to Jetpack 8.8.2 again.

    Thread Starter bilalmubdir

    (@bilalmubdir)

    No I have Jetpack 8.8.2 and I have disabled this module, the same issue happen

    Plugin Support KokkieH

    (@kokkieh)

    If Protect and Jetpack SSO are both disabled, I don’t see how Jetpack can be blocking logins to your site, so this might be an issue on the API’s end itself.

    Can you ask in the advanced forum if anyone from that end has any ideas?

    https://www.ads-software.com/support/forum/wp-advanced/

    Thread Starter bilalmubdir

    (@bilalmubdir)

    Dear KokkieH,

    In my first post I had mentioned that “The login process is using wp_signon function with nonce (_wpnonce) and redirection. The issue that when I log in with nonce and Jetpack plugin active, the function return 0. If I logged in without nonce also it works seven if Jetpack active.

    So it is jetpack issue, with old version of the plugin there is no issue.

    Where my api function simply is:

    public function login()
    {
    $creds = array(
    ‘user_login’ => addslashes(rawurldecode($_REQUEST[‘username’])),
    ‘user_password’ => addslashes(rawurldecode($_REQUEST[‘password’])),
    ‘remember’ => true,
    );

    $user = wp_signon( apply_filters( ‘woocommerce_login_credentials’, $creds ), is_ssl() );

    wp_send_json( $user );

    }

    Plugin Support KokkieH

    (@kokkieh)

    We’re not able to help with custom code implementations like this, and based on the information you’ve provided we don’t have enough data to confirm that this is being caused by Jetpack.

    You can view the code Jetpack uses at https://github.com/automattic/jetpack. Check what Jetpack features might be interacting with your code via filters (different features such as Protect or SSO rely on hooks inside the core login functionality such as wp_authenticate or wp_login), disable said feature to see if one in particular appears to conflict with your code, and then try to understand why the conflict happens.

    If you find a bug with the Jetpack implementation, you can then open an issue directly in that GitHub repo to report this to our developers.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Login return false’ is closed to new replies.