fetch registration flows

This commit is contained in:
RMidhunSuresh 2021-12-23 15:17:09 +05:30
parent 65dcf8bc36
commit 618d02d838

View file

@ -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",