vrchatapi-javascript icon indicating copy to clipboard operation
vrchatapi-javascript copied to clipboard

AuthenticationApi.verify2FA not working due to incorrect data format

Open theautonomousdev opened this issue 1 year ago • 2 comments
trafficstars

AuthenticationApi.verify2FA fails returning a HTTP status code 400 due to incorrect data format in the request, in the code the format is the following:

vrchat/dist/api.js - line 627 localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(twoFactorAuthCode, localVarRequestOptions, configuration);

api.ts - line 7116 localVarRequestOptions.data = serializeDataIfNeeded(twoFactorAuthCode, localVarRequestOptions, configuration)

According to the VRChat API Docs (https://vrchatapi.github.io/docs/api/#post-/auth/twofactorauth/totp/verify) the code should be nested:

vrchat/dist/api.js - line 627

localVarRequestOptions.data = {
  code: (0, common_1.serializeDataIfNeeded)(twoFactorAuthCode, localVarRequestOptions, configuration)
}

api.ts - line 7116

localVarRequestOptions.data = {
  code: serializeDataIfNeeded(twoFactorAuthCode, localVarRequestOptions, configuration)
};

Making the above change fixes the issue, it looks like the same issue may effect verify2FAEmailCode and verifyRecoveryCode looking at the code but I haven't tested and confirmed this.

theautonomousdev avatar Jul 18 '24 13:07 theautonomousdev