• I am making Hybrid app with WordPress database in php, I am using JWT WordPress plugin to authenticate users. But token is expiring in almost 20 minutes, I am using following code to extend the expiry time, But it is not working. Any help is appreciate.

    add_filter( 'jwt_auth_token_before_sign', 'increase_xpirty_time_token' );
    function increase_xpirty_time_token( $token, $user, $aaaa, $bbbb)
    {
      $issuedAt = time();
      $notBefore = apply_filters('jwt_auth_not_before', $issuedAt, $issuedAt);
      $expire = apply_filters('jwt_auth_expire', $issuedAt + (DAY_IN_SECONDS * 700), $issuedAt);
    
      $token = array(
        'iss' => get_bloginfo('url'),
        'iat' => $issuedAt,
        'nbf' => $notBefore,
        'exp' => $expire,
        'data' => array(
            'user' => array(
                'id' => $user->data->ID,
            )
        )
    );
    
      return  $token;
    }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to extend expiry time of jwt wordpress token?’ is closed to new replies.