Pass back the user_id in the response to /login in case it has changed. Store and use that on the webclient rather than the input field.

This commit is contained in:
Kegan Dougal 2014-08-14 16:40:15 +01:00
parent ca3747fb2f
commit fef3183461
4 changed files with 9 additions and 7 deletions

View file

@ -79,7 +79,7 @@ angular.module('LoginController', ['matrixService'])
$scope.feedback = "Login successful.";
matrixService.setConfig({
homeserver: $scope.account.homeserver,
user_id: $scope.account.user_id,
user_id: response.data.user_id,
access_token: response.data.access_token
});
matrixService.saveConfig();

View file

@ -24,7 +24,7 @@
<!-- Login with an registered user -->
<div>{{ login_error_msg }} </div>
<div>
<input id="user_id" size="70" type="text" auto-focus ng-model="account.user_id" placeholder="User ID (ex:@bob:localhost)"/>
<input id="user_id" size="70" type="text" auto-focus ng-model="account.user_id" placeholder="User ID (ex:@bob:localhost or bob)"/>
<br />
<input id="password" size="70" type="password" ng-model="account.password" placeholder="Password"/><br />
<br/>