mirror of
https://gitlab.com/commento/commento.git
synced 2025-06-29 22:56:37 -04:00
frontend: check in html, css, js
This commit is contained in:
20
frontend/js/self.js
Normal file
20
frontend/js/self.js
Normal file
@ -0,0 +1,20 @@
|
||||
(function (global, document) {
|
||||
|
||||
// Get self details.
|
||||
global.selfGet = function(callback) {
|
||||
var json = {
|
||||
"session": global.cookieGet("session"),
|
||||
};
|
||||
|
||||
global.post(global.origin + "/api/owner/self", json, function(resp) {
|
||||
if (!resp.success || !resp.loggedIn) {
|
||||
document.location = "/login";
|
||||
return;
|
||||
}
|
||||
|
||||
global.owner = resp.owner;
|
||||
callback();
|
||||
});
|
||||
};
|
||||
|
||||
}(window, document));
|
Reference in New Issue
Block a user