Skip to content

Commit 378802a

Browse files
authored
Stabilise token authenticated registration support (#2181)
* 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 <[email protected]> * 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 <[email protected]>
1 parent f963fea commit 378802a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/interactive-auth.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ export enum AuthType {
6060
Sso = "m.login.sso",
6161
SsoUnstable = "org.matrix.login.sso",
6262
Dummy = "m.login.dummy",
63-
RegistrationToken = "org.matrix.msc3231.login.registration_token",
63+
RegistrationToken = "m.login.registration_token",
64+
// For backwards compatability with servers that have not yet updated to
65+
// use the stable "m.login.registration_token" type.
66+
// The authentication flow is the same in both cases.
67+
UnstableRegistrationToken = "org.matrix.msc3231.login.registration_token",
6468
}
6569

6670
export interface IAuthDict {
@@ -79,7 +83,8 @@ export interface IAuthDict {
7983
// eslint-disable-next-line camelcase
8084
threepid_creds?: any;
8185
threepidCreds?: any;
82-
registrationToken?: string;
86+
// For m.login.registration_token type
87+
token?: string;
8388
}
8489

8590
class NoAuthFlowFoundError extends Error {

0 commit comments

Comments
 (0)