Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AuthenticationApi.verify2FA not working due to incorrect data format #8

Open
theautonomousdev opened this issue Jul 18, 2024 · 2 comments

Comments

@theautonomousdev
Copy link

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.

@ar-Kitty
Copy link

The path of the URL is invalid. It should be /auth/twofactorauth/totp/verify. In the codebase, it is /auth/twofactorauth/otp/verify. Also, you are right.

@ar-Kitty
Copy link

The path of the URL is invalid. It should be /auth/twofactorauth/totp/verify. In the codebase, it is /auth/twofactorauth/otp/verify. Also, you are right.

mb i was looking at verifyRecoveryCode instad of verify2FA...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants