From 618d02d838b62abf37ac24cca6b626059be1a812 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Thu, 23 Dec 2021 15:17:09 +0530 Subject: [PATCH] fetch registration flows --- src/matrix/net/HomeServerApi.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/matrix/net/HomeServerApi.ts b/src/matrix/net/HomeServerApi.ts index a23321f9..4a84adf0 100644 --- a/src/matrix/net/HomeServerApi.ts +++ b/src/matrix/net/HomeServerApi.ts @@ -26,6 +26,7 @@ import type {ILogItem} from "../../logging/types"; type RequestMethod = "POST" | "GET" | "PUT"; const CS_R0_PREFIX = "/_matrix/client/r0"; +const CS_V3_PREFIX = "/_matrix/client/v3"; const DEHYDRATION_PREFIX = "/_matrix/client/unstable/org.matrix.msc2697.v2"; type Options = { @@ -163,6 +164,10 @@ export class HomeServerApi { return this._unauthedRequest("GET", this._url("/login")); } + getRegistrationFlows(): IHomeServerRequest { + return this._unauthedRequest("POST", this._url("/register", CS_V3_PREFIX), undefined, { auth: {} }); + } + passwordLogin(username: string, password: string, initialDeviceDisplayName: string, options?: IRequestOptions): IHomeServerRequest { return this._unauthedRequest("POST", this._url("/login"), undefined, { "type": "m.login.password",