Ver Fonte

Bugfix: right way to get login data

febbweiss há 10 anos atrás
pai
commit
47ba761954

+ 3 - 3
public/js/services/authentication.service.js

@@ -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 {

+ 1 - 1
public/login/login.view.html

@@ -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>