+
+
+
diff --git a/web-frontend/js/authProvider.js b/web-frontend/js/authProvider.js
index 3957731..e9e70db 100644
--- a/web-frontend/js/authProvider.js
+++ b/web-frontend/js/authProvider.js
@@ -1,7 +1,7 @@
angular.module('Come2HelpApp').config(['$authProvider', function ($authProvider) {
$authProvider.signupUrl = '/api/volunteers';
- $authProvider.loginUrl = '/api/login/volunteer';
+ $authProvider.loginUrl = '/api/login/helfenkannjeder';
$authProvider.facebook({
clientId: '417693555105063',
diff --git a/web-frontend/js/controllers/NavigationController.js b/web-frontend/js/controllers/NavigationController.js
index b046e78..8f451c9 100644
--- a/web-frontend/js/controllers/NavigationController.js
+++ b/web-frontend/js/controllers/NavigationController.js
@@ -1,17 +1,37 @@
angular.module('Come2HelpApp')
-.controller('NavigationController', ['jwtService', '$location', function(jwtService, $location) {
- var vm = this;
+ .controller('NavigationController', ['jwtService', '$location', '$auth', function (jwtService, $location, $auth) {
+ var vm = this;
- vm.authenticated = jwtService.isAuthenticated.bind(jwtService);
- vm.isGuest = jwtService.isGuest.bind(jwtService);
- vm.isOrganisation = jwtService.isOrganisation.bind(jwtService);
- vm.logout = jwtService.logout;
+ vm.user = {};
+ vm.authenticated = jwtService.isAuthenticated.bind(jwtService);
+ vm.isGuest = jwtService.isGuest.bind(jwtService);
+ vm.isOrganisation = jwtService.isOrganisation.bind(jwtService);
+ vm.logout = jwtService.logout;
- vm.getClass = function (path) {
- if ($location.path().substr(0, path.length) === path) {
- return 'active';
- } else {
- return '';
- }
- };
-}]);
\ No newline at end of file
+ vm.credentials = {};
+
+ vm.login = function() {
+ // user transport object
+ var transUser = {
+ email: vm.user.email || '',
+ password: vm.user.password || ''
+ };
+ console.log(transUser);
+
+ $auth.login(transUser)
+ .then(function () {
+ // Do nothing, global handling do everything
+ })
+ .catch(function () {
+ alert('login error');
+ });
+ };
+
+ vm.getClass = function (path) {
+ if ($location.path().substr(0, path.length) === path) {
+ return 'active';
+ } else {
+ return '';
+ }
+ };
+ }]);
\ No newline at end of file
diff --git a/web-frontend/test/behaviour/register.js b/web-frontend/test/behaviour/register.js
index 4f2b96c..1567860 100644
--- a/web-frontend/test/behaviour/register.js
+++ b/web-frontend/test/behaviour/register.js
@@ -45,7 +45,7 @@ function signupWith(data) {
}
// Submit
- $('button[type="submit"]').click();
+ $('.panel-body button[type="submit"]').click();
}
/**