mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Allow register without providing username
This commit is contained in:
parent
170d7a5e55
commit
fa2e2bc8f3
@ -165,19 +165,20 @@ export class HomeServerApi {
|
||||
return this._unauthedRequest("GET", this._url("/login"));
|
||||
}
|
||||
|
||||
register(username: string, password: string, initialDeviceDisplayName: string, auth?: Record<string, any>, inhibitLogin?: boolean , options?: IRequestOptions): IHomeServerRequest {
|
||||
register(username: string | null, password: string, initialDeviceDisplayName: string, auth?: Record<string, any>, inhibitLogin?: boolean , options?: IRequestOptions): IHomeServerRequest {
|
||||
// todo: This is so that we disable cache-buster because it would cause the hs to respond with error
|
||||
// see https://github.com/matrix-org/synapse/issues/7722
|
||||
// need to this about the implications of this later
|
||||
const _options = options ?? {};
|
||||
Object.assign(_options, { cache: true });
|
||||
const _username = username ?? undefined;
|
||||
return this._unauthedRequest(
|
||||
"POST",
|
||||
this._url("/register", CS_V3_PREFIX),
|
||||
undefined,
|
||||
{
|
||||
auth,
|
||||
username,
|
||||
_username,
|
||||
password,
|
||||
initial_device_displayname: initialDeviceDisplayName,
|
||||
inhibit_login: inhibitLogin ?? false,
|
||||
|
Loading…
Reference in New Issue
Block a user