mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Ensure that all API calls and static resources are in their own unique paths. This makes it easier to add a load balancer on top of everything.
This commit is contained in:
parent
7da3c91289
commit
1d77d8c97d
34 changed files with 37 additions and 36 deletions
|
@ -1,37 +0,0 @@
|
|||
define(['./module'], function(mod) {
|
||||
mod.controller('SignInCtrl', ['$scope', '$http', function($scope, $http) {
|
||||
$scope.error = null
|
||||
|
||||
$scope.submit = function() {
|
||||
var data = {
|
||||
name: $scope.signin.name.$modelValue
|
||||
, email: $scope.signin.email.$modelValue
|
||||
}
|
||||
$scope.invalid = false
|
||||
$http.post('/api/v1/auth/mock', 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