Skip to content
Snippets Groups Projects
Commit 4ffb2505 authored by Maxime's avatar Maxime
Browse files

Authetification fix ==> OK

parent 4078161b
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ app.controller('AuthController', ['$scope', '$rootScope', '$localStorage', '$loc ...@@ -7,6 +7,7 @@ app.controller('AuthController', ['$scope', '$rootScope', '$localStorage', '$loc
if (!results.errors) { if (!results.errors) {
$rootScope.$storage = $localStorage; $rootScope.$storage = $localStorage;
$rootScope.$storage.userSession = results && results.username; $rootScope.$storage.userSession = results && results.username;
$location.path('/');
} else { } else {
$scope.errors = results.errors; $scope.errors = results.errors;
} }
...@@ -24,4 +25,4 @@ app.controller('AuthController', ['$scope', '$rootScope', '$localStorage', '$loc ...@@ -24,4 +25,4 @@ app.controller('AuthController', ['$scope', '$rootScope', '$localStorage', '$loc
// } // }
}; };
}]); }]);
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
app.factory('AuthService', ['$q', '$http', function($q, $http) { app.factory('AuthService', ['$q', '$http', function($q, $http) {
this.login = function(data) { this.login = function(data) {
var deferred = $q.defer(); var deferred = $q.defer();
$http.post(URL_DEVICE + '/login', data).then( $http.post(URL_LOGIN, data).then(
function(result) { function(result) {
deferred.resolve(result.data); deferred.resolve(result.data);
}, },
...@@ -23,4 +23,4 @@ app.factory('AuthService', ['$q', '$http', function($q, $http) { ...@@ -23,4 +23,4 @@ app.factory('AuthService', ['$q', '$http', function($q, $http) {
}; };
return this; return this;
}]); }]);
\ No newline at end of file
/* URL declaration */ /* URL declaration */
var URL_LOGIN = '/om2m/nscl/applications/CIMA/administration/login';
var URL_DEVICE = '/om2m/nscl/applications/CIMA/administration/device'; var URL_DEVICE = '/om2m/nscl/applications/CIMA/administration/device';
//var URL_DEVICE = 'json/newformatdevices.json'; //var URL_DEVICE = 'json/newformatdevices.json';
//var URL_DEVICE = 'json/goodjson.json'; //var URL_DEVICE = 'json/goodjson.json';
......
webapp 0 → 120000
org.eclipse.om2m/org.eclipse.om2m.webapp.resourcesbrowser/src/main/resources/webapps/cima/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment