mirror of
https://github.com/Febbweiss/CloudBudget-AngularJS.git
synced 2026-03-04 22:35:38 +00:00
Bugfix: right way to get login data
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user