skip to Main Content

I want to get token from wooCommerce rest api in mobile app, I am using jwt_auth plugin for login customer it create token for me but when I want to use Password_reset plugin for forgot password jwt does not allow because it want token. so How can I get token without login.

2

Answers


  1. If you want to generate token without user login then it will decrease security of your app.

    I would suggest you to create some custom endpoints for password reset and whitelist them from jwt like this –

    add_filter( 'jwt_auth_whitelist', function ( $endpoints ) {
        return array(
            '/wp-json/custom/v1/webhook/*',
            '/wp-json/custom/v1/otp/*',
            '/wp-json/custom/v1/account/check',
            '/wp-json/custom/v1/register',
        );
    } );
    
    Login or Signup to reply.
  2. You need make custom route without any token for your change password and forget password

    for make forget password and change password you need

    1. check email or username exits
    2. if exits send a verify code to email for confirmation
    3. after check the code is valid make new custom rest api for change password
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search