frontend: prefix ownerToken with commento

This commit is contained in:
Adhityaa 2018-06-20 09:06:49 +05:30
parent be85a911aa
commit 9b021d47e4
7 changed files with 11 additions and 11 deletions

View File

@ -36,7 +36,7 @@
// Creates a new domain. // Creates a new domain.
global.domainNewHandler = function() { global.domainNewHandler = function() {
var json = { var json = {
"ownerToken": global.cookieGet("ownerToken"), "ownerToken": global.cookieGet("commentoOwnerToken"),
"name": $("#new-domain-name").val(), "name": $("#new-domain-name").val(),
"domain": $("#new-domain-domain").val(), "domain": $("#new-domain-domain").val(),
} }
@ -66,7 +66,7 @@
// Refreshes the list of domains. // Refreshes the list of domains.
global.domainRefresh = function(callback) { global.domainRefresh = function(callback) {
var json = { var json = {
ownerToken: global.cookieGet("ownerToken"), "ownerToken": global.cookieGet("commentoOwnerToken"),
}; };
global.post(global.commentoOrigin + "/api/domain/list", json, function(resp) { global.post(global.commentoOrigin + "/api/domain/list", json, function(resp) {
@ -107,7 +107,7 @@
// Updates a domain with the backend. // Updates a domain with the backend.
global.domainUpdate = function(domain, callback) { global.domainUpdate = function(domain, callback) {
var json = { var json = {
"ownerToken": global.cookieGet("ownerToken"), "ownerToken": global.cookieGet("commentoOwnerToken"),
"domain": domain, "domain": domain,
}; };
@ -126,7 +126,7 @@
// Deletes a domain. // Deletes a domain.
global.domainDelete = function(domain, callback) { global.domainDelete = function(domain, callback) {
var json = { var json = {
"ownerToken": global.cookieGet("ownerToken"), "ownerToken": global.cookieGet("commentoOwnerToken"),
"domain": domain, "domain": domain,
}; };

View File

@ -12,7 +12,7 @@
var data = global.dashboard.$data; var data = global.dashboard.$data;
var json = { var json = {
"ownerToken": global.cookieGet("ownerToken"), "ownerToken": global.cookieGet("commentoOwnerToken"),
"domain": data.domains[data.cd].domain, "domain": data.domains[data.cd].domain,
"url": url, "url": url,
} }

View File

@ -13,7 +13,7 @@
var email = $("#new-mod").val(); var email = $("#new-mod").val();
var json = { var json = {
"ownerToken": global.cookieGet("ownerToken"), "ownerToken": global.cookieGet("commentoOwnerToken"),
"domain": data.domains[data.cd].domain, "domain": data.domains[data.cd].domain,
"email": email, "email": email,
} }
@ -53,7 +53,7 @@
var data = global.dashboard.$data; var data = global.dashboard.$data;
var json = { var json = {
"ownerToken": global.cookieGet("ownerToken"), "ownerToken": global.cookieGet("commentoOwnerToken"),
"domain": data.domains[data.cd].domain, "domain": data.domains[data.cd].domain,
"email": email, "email": email,
} }

View File

@ -38,7 +38,7 @@
var data = global.dashboard.$data; var data = global.dashboard.$data;
var json = { var json = {
"ownerToken": global.cookieGet("ownerToken"), "ownerToken": global.cookieGet("commentoOwnerToken"),
"domain": data.domains[data.cd].domain, "domain": data.domains[data.cd].domain,
} }

View File

@ -65,7 +65,7 @@
return; return;
} }
global.cookieSet("ownerToken", resp.ownerToken); global.cookieSet("commentoOwnerToken", resp.ownerToken);
document.location = "/dashboard"; document.location = "/dashboard";
}); });
}; };

View File

@ -1,7 +1,7 @@
(function (global, document) { (function (global, document) {
global.logout = function() { global.logout = function() {
global.cookieSet("ownerToken", ""); global.cookieSet("commentoOwnerToken", "");
document.location = "/login"; document.location = "/login";
} }

View File

@ -3,7 +3,7 @@
// Get self details. // Get self details.
global.selfGet = function(callback) { global.selfGet = function(callback) {
var json = { var json = {
"ownerToken": global.cookieGet("ownerToken"), "ownerToken": global.cookieGet("commentoOwnerToken"),
}; };
global.post(global.commentoOrigin + "/api/owner/self", json, function(resp) { global.post(global.commentoOrigin + "/api/owner/self", json, function(resp) {