wp-api-jwt-auth icon indicating copy to clipboard operation
wp-api-jwt-auth copied to clipboard

Passwords with special character fail

Open dustbro opened this issue 1 year ago • 2 comments

Passwords with special character fail login

Context

I’m using JWT to authenticate users from my app, and everything works as expected…. except if the password contains a “ in it. Having a quote in the password returns an error saying the username or password is incorrect.

Is there anything that can fix this other than having the user change their password?

Expected Behavior

The same password that a user has on my wordpress site should work for JWT authentication.

Current Behavior

Having a quote in the password returns an error saying the username or password is incorrect.

dustbro avatar Jan 05 '24 03:01 dustbro

Hi,

Problem fixed with addslashs fx.

$user = wp_authenticate( $username, addslashes($password) ); on line 139 in file class-jwt-auth-public.php

Fix required from author side ;)

RpGmAx avatar Feb 22 '24 12:02 RpGmAx

@Tmeister would you be able to add this fix to the next update?

dustbro avatar May 09 '24 13:05 dustbro