mirror of
https://github.com/stoatchat/javascript-client-api.git
synced 2026-08-26 21:41:13 -04:00
bug: Usage to complete MFA on login doesn't work as documented #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MasicoreLord on GitHub (Apr 14, 2023).
What happened?
On this page:
https://developers.revolt.chat/api/#tag/Session/operation/login_login
On the first request sample, where it shows what to do to fufil mfa as copied here:
It'd throw error code 400 (Bad Request)
Turns out when inspecting network traffic from Revite, where it'd say password, it actually uses a field named "totp_code", which did work as intended and generated a new login session.
@Zomatree commented on GitHub (Apr 14, 2023):
You can only do the MFA variants which are in the initial login response under the
allowed_methodskey, if"Password"is not in that list then you cannot attempt to do password MFA.The docs show this here:


@MasicoreLord commented on GitHub (Apr 14, 2023):
Oh I see, the docs were not very clear on that, lol, also from that I realized I got to also handle the case a user would want to enter their recovery code.
@MasicoreLord commented on GitHub (Apr 14, 2023):
Didn't see that second any of section from my view, so that explains my confusion:

@MasicoreLord commented on GitHub (Apr 14, 2023):
I made a user errror in using the docs, and didn't think to use the drop down under mfa_response to see the options.