mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Object.assign is overkill here
This commit is contained in:
parent
e8dbbd876c
commit
5f11790f6b
@ -158,7 +158,7 @@ export class HomeServerApi {
|
|||||||
|
|
||||||
register(username: string | null, password: string, initialDeviceDisplayName: string, auth?: Record<string, any>, inhibitLogin: boolean = true , options: IRequestOptions = {}): IHomeServerRequest {
|
register(username: string | null, password: string, initialDeviceDisplayName: string, auth?: Record<string, any>, inhibitLogin: boolean = true , options: IRequestOptions = {}): IHomeServerRequest {
|
||||||
Object.assign(options, { allowedErrors: [401] });
|
Object.assign(options, { allowedErrors: [401] });
|
||||||
const body = {
|
const body: any = {
|
||||||
auth,
|
auth,
|
||||||
password,
|
password,
|
||||||
initial_device_displayname: initialDeviceDisplayName,
|
initial_device_displayname: initialDeviceDisplayName,
|
||||||
@ -166,7 +166,7 @@ export class HomeServerApi {
|
|||||||
};
|
};
|
||||||
if (username) {
|
if (username) {
|
||||||
// username is optional for registration
|
// username is optional for registration
|
||||||
Object.assign(body, { username });
|
body.username = username;
|
||||||
}
|
}
|
||||||
return this._unauthedRequest( "POST", this._url("/register", CS_V3_PREFIX), undefined, body, options);
|
return this._unauthedRequest( "POST", this._url("/register", CS_V3_PREFIX), undefined, body, options);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user