name devices at login "Hydrogen"

so you can somewhat identify them in a device list
This commit is contained in:
Bruno Windels 2020-09-08 10:53:15 +02:00
parent 2c5c3ac8e2
commit dea9fd90b4
2 changed files with 4 additions and 3 deletions

View File

@ -89,7 +89,7 @@ export class SessionContainer {
let sessionInfo; let sessionInfo;
try { try {
const hsApi = new HomeServerApi({homeServer, request: this._request, createTimeout: this._clock.createTimeout}); const hsApi = new HomeServerApi({homeServer, request: this._request, createTimeout: this._clock.createTimeout});
const loginData = await hsApi.passwordLogin(username, password).response(); const loginData = await hsApi.passwordLogin(username, password, "Hydrogen").response();
const sessionId = this.createNewSessionId(); const sessionId = this.createNewSessionId();
sessionInfo = { sessionInfo = {
id: sessionId, id: sessionId,

View File

@ -141,14 +141,15 @@ export class HomeServerApi {
{}, {}, options); {}, {}, options);
} }
passwordLogin(username, password, options = null) { passwordLogin(username, password, initialDeviceDisplayName, options = null) {
return this._post("/login", null, { return this._post("/login", null, {
"type": "m.login.password", "type": "m.login.password",
"identifier": { "identifier": {
"type": "m.id.user", "type": "m.id.user",
"user": username "user": username
}, },
"password": password "password": password,
"initial_device_display_name": initialDeviceDisplayName
}, options); }, options);
} }