Skip to content

Commit

Permalink
Merge pull request #59 from GeoSmartCity-CIP/feature/qa-fixes
Browse files Browse the repository at this point in the history
Removed test user capability
  • Loading branch information
AndreaDiNora committed Feb 23, 2017
2 parents 53a122d + 3707494 commit 8fdb54d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 49 deletions.
2 changes: 1 addition & 1 deletion client/src/app/createUser/createUser.js
Expand Up @@ -126,7 +126,7 @@ angular.module('gscDatacat.controllers')
if (gsc.util.isNull($scope.data.user.organizations)) {
$scope.data.user.organizations = [];
}

if ($scope.data.user.organizations.length < 2) {
$rootScope.console.usrInfo('The user must at minimum belong to one organization');
return;
Expand Down
4 changes: 2 additions & 2 deletions client/src/app/loginForm/loginForm.js
Expand Up @@ -24,8 +24,8 @@ angular.module('gscDatacat.controllers')
$scope.authSvc = authSvc;

$scope.loginData = {
username: '' + authSvc.sampleUsr.username,
password: '' + authSvc.sampleUsr.password
username: '',
password: ''
};

$scope.login = function() {
Expand Down
48 changes: 2 additions & 46 deletions client/src/services/authSvc.js
Expand Up @@ -28,54 +28,11 @@ angular.module('gscDatacat.services')
'MapVisibility': 187
};

var _sampleUser = {
iduser: 1,
username: 'admin@geosmartcity.eu',
password: 'geosmartcity',
organizationId: 666,
organizations: [{
id: 666,
organizationname: 'Asplan Viak Internet as'
}],
roles: [{
idrole: 1,
functions: [
{
idfunction: 1
},
{
idfunction: 2
},
{
idfunction: 3
},
{
idfunction: 4
},
{
idfunction: 5
},
{
idfunction: 6
},
{
idfunction: 7
}
]
}]
};

var _login = function(username, password) {

var dfd = $q.defer();

if (username === _sampleUser.username &&
password === _sampleUser.password) {
gsc.util.clearExtendObject($rootScope.data.authUser, _sampleUser);
dfd.resolve(gscDatacat.Response.getSuccess($rootScope.data.authUser,
'Local login shim succeeded'));
} else {
gsc.user.login(username, password)
gsc.user.login(username, password)
.then(function(res) {
if (res.iduser !== undefined && gsc.util.isNumber(res.iduser)) {
gsc.util.clearExtendObject($rootScope.data.authUser, {});
Expand Down Expand Up @@ -106,7 +63,6 @@ angular.module('gscDatacat.services')
}
}, 'Could not perform login with supplied details'));
});
}

return dfd.promise;
};
Expand Down Expand Up @@ -169,7 +125,7 @@ angular.module('gscDatacat.services')
logout: _logout,
isAuth: _isAuth,
authUsr: $rootScope.data.authUser,
sampleUsr: _sampleUser,
//sampleUsr: _sampleUser,
can: _userCan,
systemFunctions: $rootScope.data.systemFunctions,
canLockUser: function() {
Expand Down

0 comments on commit 8fdb54d

Please sign in to comment.