--- a/client/app/auth/auth_controller.js Thu Jun 04 20:08:01 2015 +0200
+++ b/client/app/auth/auth_controller.js Thu Jun 04 20:09:20 2015 +0200
@@ -14,11 +14,11 @@
})
.controller('authloginCtrl', function($modalInstance, $scope, authApi, $window, $http, $rootScope){
$scope.login = function(){
- authApi.login.save({username:$scope.username, password:$scope.password}, function(data){
+ authApi.login.save({email:$scope.email, password:$scope.password}, function(data){
$rootScope.globals.userLogged = true;
localStorage.setItem('token', data.token);
$http.defaults.headers.common.Authorization = 'Token ' + localStorage.getItem('token');
- $modalInstance.close('/books');
+ $modalInstance.close('/');
});
};
$scope.register = function () {
@@ -39,7 +39,6 @@
.controller('authregisterCtrl', function($scope, $modalInstance, authApi){
$scope.register = function () {
authApi.user.save({
- username: $scope.username,
email: $scope.email,
password: $scope.password,
}, function(){
--- a/client/app/auth/login_modal.html Thu Jun 04 20:08:01 2015 +0200
+++ b/client/app/auth/login_modal.html Thu Jun 04 20:09:20 2015 +0200
@@ -4,7 +4,7 @@
<form ng-submit="login()">
<div class="modal-body ng-scope">
- <input type="text" class="form-control" ng-model='username' placeholder="Username">
+ <input type="text" class="form-control" ng-model='email' placeholder="Email">
<input type="password" class="form-control" ng-model='password' placeholder="Password">
</div>