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:
parent
15a6a1ab24
commit
c588dd87c6
15 changed files with 77 additions and 130 deletions
36
res/auth/ldap/scripts/signin/signin-controller.js
Normal file
36
res/auth/ldap/scripts/signin/signin-controller.js
Normal 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
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue