Bugfix: right way to get login data

This commit is contained in:
2015-09-25 08:40:03 +00:00
parent 06e2bceb00
commit 47ba761954
2 changed files with 4 additions and 4 deletions

View File

@@ -17,11 +17,11 @@
function login(username, password ) {
return $http.post( apiRoutes.login, {username: username, password: password})
.then(function(response, status) {
if( status === 200 ) {
.then(function(response) {
if( response.status === 200 ) {
return {
success: true,
user: response
user: response.data
};
} else {
return {

View File

@@ -8,7 +8,7 @@
<span ng-show="form.username.$dirty && form.username.$error.required" class="help-block">Username is required</span>
</div>
<div class="form-group" ng-class="{'has-error': form.password.$dirty && form.password.$error.required}">
<label for="username">Password</label>
<label for="password">Password</label>
<input type="password" name="password" id="password" class="form-control" ng-model="vm.password" required />
<span ng-show="form.password.$dirty && form.password.$error.required" class="help-block">Password is required</span>
</div>