1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00

Use webpack instead of require.js for LDAP authentication.

Removing Japanese hardcoded strings (Needs gettext loading code).
This commit is contained in:
Gunther Brunner 2015-06-30 19:44:04 +09:00
parent 15a6a1ab24
commit c588dd87c6
15 changed files with 77 additions and 130 deletions

View file

@ -0,0 +1,36 @@
module.exports = function SignInCtrl($scope, $http) {
$scope.error = null
$scope.submit = function () {
var data = {
username: $scope.signin.username.$modelValue
, password: $scope.signin.password.$modelValue
}
$scope.invalid = false
$http.post('/auth/api/v1/ldap', data)
.success(function (response) {
$scope.error = null
location.replace(response.redirect)
})
.error(function (response) {
switch (response.error) {
case 'ValidationError':
$scope.error = {
$invalid: true
}
break
case 'InvalidCredentialsError':
$scope.error = {
$incorrect: true
}
break
default:
$scope.error = {
$server: true
}
break
}
})
}
}