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

Missing "requiresTwoFactorAuth" object #241

Open
iryis opened this issue May 28, 2023 · 3 comments · May be fixed by #352
Open

Missing "requiresTwoFactorAuth" object #241

iryis opened this issue May 28, 2023 · 3 comments · May be fixed by #352
Labels
Priority: High High priority, this ideally needs to be fixed first Status: Invalid This is an incorrect/invalid Issue or Pull Request Type: Bug There is a **factual incorrectness** in the spec

Comments

@iryis
Copy link

iryis commented May 28, 2023

In the event the account requires 2FA, regardless of method, the CurrentUser object will be replaced with an object similar to

{"requiresTwoFactorAuth":["totp", "otp"]}

I have only seen this be totp and otp together, or emailOtp.

Given that some of the generated libraries do JSON validation, the absence of this causes an error. (however, you can circumvent this in languages like Javascript)

@Foorack
Copy link
Member

Foorack commented Jun 26, 2023

The problem is that the API returns "200" even if it returns this "error object", and we can't specify duplicate HTTP 200 responses in the spec, as they would have the same key.

You can specify that a code returns either, e.g. <User | ReqMFAAuth>, but almost no generator, and not all languages, support that. So due to this API design it is something we will have to fix in each SDK instead. We have already started patching some of them, like Python IIRC. But I can't immediatley think of a clean solution, unless VRC changes the API to return a different HTTP code for the two different objects.

We should create a tracking Issue for making sure the SDK's are patched on this issue.

@Foorack Foorack added Type: Bug There is a **factual incorrectness** in the spec Priority: High High priority, this ideally needs to be fixed first Status: Invalid This is an incorrect/invalid Issue or Pull Request Status: Blocked Something is blocking this from progressing and removed Status: Blocked Something is blocking this from progressing labels Jun 26, 2023
@iryis
Copy link
Author

iryis commented Oct 10, 2023

Just found #259 (comment) Which in doing so would likely resolve this as well as subsequent library/language specific issues

@Rexios80
Copy link
Collaborator

I handle this manually in the Dart SDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High High priority, this ideally needs to be fixed first Status: Invalid This is an incorrect/invalid Issue or Pull Request Type: Bug There is a **factual incorrectness** in the spec
3 participants