Using a stateless attribute, such as JWT, is safe if the secret you use to sign the token is a way to verify its security. But there are some additional aspects that you should consider before using JWT as an authenticator in your password - reset URI ...
Since you cannot invalidate a specific JWT (without saving the state again), and expiration is not enough (in this particular case), what you basically want to have is your JWT, which is usually known as a one-time or one-time token. The reason for this is because you probably don't want the single password-reset -link to be used more than once to reset the password, as this would allow potential attackers to completely block the user (by constantly changing passwords).
I described how this can work here: Disposable tokens with JWT - basically you will need to turn some kind of state in you on your server side (in your case, for example, a password hash of users) into an HMAC key and use this to sign your user-specific token. This will cause the token verification to fail after changing the password ...
source share