token-validator: maatma should be the root of token-validator

This commit is contained in:
nemunaire 2020-03-01 18:20:16 +01:00
parent a4a7b48a4f
commit e1f7027109
3 changed files with 55 additions and 118 deletions

View file

@ -37,7 +37,7 @@ angular.module("AdLinApp")
$rootScope.checkLoginState = function() {
$http({
method: 'GET',
url: "/api/auth",
url: "api/auth",
}).then(function(response) {
$rootScope.isLogged = response.data;
$rootScope.student = response.data;
@ -51,7 +51,7 @@ angular.module("AdLinApp")
$rootScope.disconnectCurrentUser = function() {
$http({
method: 'POST',
url: "/api/auth/logout"
url: "api/auth/logout"
}).then(function(response) {
$rootScope.isLogged = false;
$rootScope.student = null;
@ -62,7 +62,7 @@ angular.module("AdLinApp")
.controller("ProgressionController", function($scope, $interval, $http) {
$scope.mychallenges = {};
var refreshChal = function() {
$http.get("/api/students/" + $scope.student.id + "/progress").then(function(response) {
$http.get("api/students/" + $scope.student.id + "/progress").then(function(response) {
$scope.mychallenges = response.data
});
}
@ -80,7 +80,7 @@ angular.module("AdLinApp")
$scope.pleaseWait = true;
$http({
method: 'POST',
url: "/api/auth",
url: "api/auth",
data: $scope.auth
}).then(function(response) {
$scope.pleaseWait = false;
@ -98,7 +98,7 @@ angular.module("AdLinApp")
$scope.updateTunnelInfo = function() {
$http({
method: 'GET',
url: "/api/wginfo",
url: "api/wginfo",
}).then(function(response) {
$scope.wginfo = response.data;
});
@ -108,7 +108,7 @@ angular.module("AdLinApp")
$scope.updateTunnelsList = function() {
$http({
method: 'GET',
url: "/api/wg/",
url: "api/wg/",
}).then(function(response) {
$scope.tunnels = response.data;
}, function(response) {
@ -123,7 +123,7 @@ angular.module("AdLinApp")
$scope.pleaseWaitNew = true;
$http({
method: 'POST',
url: "/api/wg/",
url: "api/wg/",
data: {}
}).then(function(response) {
$scope.updateTunnelsList();
@ -138,7 +138,7 @@ angular.module("AdLinApp")
tunnel.pleaseWaitDrop = true;
$http({
method: 'DELETE',
url: "/api/wg/" + tunnel.TokenText,
url: "api/wg/" + tunnel.TokenText,
data: {}
}).then(function(response) {
$scope.updateTunnelsList();
@ -165,13 +165,13 @@ angular.module("AdLinApp")
$scope.updateAssociationD = function() {
$http({
method: 'GET',
url: "/api/adomains/",
url: "api/adomains/",
}).then(function(response) {
$scope.adomains = [];
response.data.forEach(function(domain) {
$http({
method: 'GET',
url: "/api/adomains/" + domain,
url: "api/adomains/" + domain,
}).then(function(response) {
response.data.forEach(function(rr) {
$scope.adomains.push(rr);
@ -188,7 +188,7 @@ angular.module("AdLinApp")
$scope.updateDelegatedD = function() {
$http({
method: 'GET',
url: "/api/ddomains/",
url: "api/ddomains/",
}).then(function(response) {
response.data.forEach(function(domain) {
$scope.ddomains = response.data;
@ -203,7 +203,7 @@ angular.module("AdLinApp")
$scope.pleaseWaitNewAssociation = true;
$http({
method: 'POST',
url: "/api/adomains/",
url: "api/adomains/",
}).then(function(response) {
$scope.updateAssociationD();
$scope.pleaseWaitNewAssociation = false;
@ -277,7 +277,7 @@ angular.module("AdLinApp")
nsrr.values = nsrr.values.join(" ");
$http({
method: (nsrr.valuesfrom !== undefined)?'PATCH':'POST',
url: "/api/ddomains/" + nsrr.domain + "/" + nsrr.rr,
url: "api/ddomains/" + nsrr.domain + "/" + nsrr.rr,
data: nsrr,
}).then(function(response) {
$('#NSModal').modal('hide');
@ -291,7 +291,7 @@ angular.module("AdLinApp")
rr["pleaseWait" + rr.rr + "del"] = true;
$http({
method: 'DELETE',
url: "/api/ddomains/" + domain + "/" + rr.rr,
url: "api/ddomains/" + domain + "/" + rr.rr,
data: rr,
}).then(function(response) {
callOnUpdateEvt();
@ -307,7 +307,7 @@ angular.module("AdLinApp")
var updateNS = function() {
$http({
method: 'GET',
url: "/api/ddomains/" + $scope.domain + "/NS",
url: "api/ddomains/" + $scope.domain + "/NS",
}).then(function(response) {
$scope.domainNS = response.data;
});
@ -320,7 +320,7 @@ angular.module("AdLinApp")
var updateGLUE = function() {
$http({
method: 'GET',
url: "/api/ddomains/" + $scope.domain + "/GLUE",
url: "api/ddomains/" + $scope.domain + "/GLUE",
}).then(function(response) {
$scope.domainGLUE = response.data;
});
@ -333,7 +333,7 @@ angular.module("AdLinApp")
var updateDS = function() {
$http({
method: 'GET',
url: "/api/ddomains/" + $scope.domain + "/DS",
url: "api/ddomains/" + $scope.domain + "/DS",
}).then(function(response) {
$scope.domainDS = response.data;
});