* Stabilise token authenticated registration support
Token authenticated registration was added to the Matrix specification in v1.2:
https://spec.matrix.org/v1.2/client-server-api/#token-authenticated-registration
Signed-off-by: Callum Brown <callum@calcuode.com>
* Backwards compatibility with unstable auth type
Servers are not yet widely updated with support for the stable
version of the registration token UIA type.
Clients should check if the authentication type is either
`RegistrationToken` or `UnstableRegistrationToken`.
Signed-off-by: Callum Brown <callum@calcuode.com>
If `doRequest()` in `interactive-auth.ts` fails to obtain an appropriate authentication flow, it should return immediately after rejecting the promise. If it continues, it'll attempt to check `chosenFlow.stages`, which will cause an error because `chosenFlow` is `null`. This was breaking the interactive auth spec tests with Node 16.