Set new password error [credential too old]?

Hey everyone, im trying to make a change password page, but for some reason, even though im getting a new id token, it shows error credential too old.
Do you have any idea about what’s wrong?

This is my logic
so with the refresh token i make an http request to get new id token and then after setting the app variable with the new id token, i make the http request for the new password.

If you have any thoughts feel free to help