Commit d63d3a87 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

lint issues

parent e8044f03
......@@ -811,7 +811,7 @@ ServerConnector.getSessionData = function(project) {
this._sessionData = new SessionData(project);
}
if (project!==undefined && this._sessionData.getProject()===null) {
this._sessionData.setProject(project)
this._sessionData.setProject(project);
}
return this._sessionData;
};
......@@ -852,7 +852,7 @@ ServerConnector.login = function(login, password) {
if (token===undefined) {
reject(obj.error);
} else {
self.getSessionData().setToken(token)
self.getSessionData().setToken(token);
resolve(token);
}
}).catch(function(exception){
......@@ -863,11 +863,11 @@ ServerConnector.login = function(login, password) {
ServerConnector.isValidToken = function(token) {
var self = this;
return new Promise(function(resolve, reject) {
return new Promise(function(resolve) {
return self.readFile(self.isValidTokenUrl({token:token})).then(function(content) {
var obj=JSON.parse(content);
resolve(obj.error===undefined);
}).catch(function(exception){
}).catch(function(){
resolve(false);
});
});
......@@ -875,8 +875,8 @@ ServerConnector.isValidToken = function(token) {
ServerConnector.logout = function() {
var self = this;
return new Promise(function(resolve, reject) {
self.getSessionData().setToken(undefined)
return new Promise(function(resolve) {
self.getSessionData().setToken(undefined);
resolve();
});
};
......
"use strict";
/* exported logger */
var SessionObjectType = require('./SessionObjectType');
var Cookies = require('js-cookie');
......@@ -154,8 +156,8 @@ SessionData.prototype.setToken = function(token) {
}
};
SessionData.prototype.getToken = function(model) {
var key = SessionObjectType.TOKEN
SessionData.prototype.getToken = function() {
var key = SessionObjectType.TOKEN;
var value = Cookies.get(key);
return value;
};
......
......@@ -25,7 +25,7 @@ function UserPanel(params) {
var login = self.getLoginText().value;
var password = self.getPasswordText().value;
ServerConnector.login(login, password).then(function(token){
ServerConnector.login(login, password).then(function(){
window.location.reload(false);
}).catch(function(problem){
GuiConnector.alert(problem);
......@@ -33,7 +33,7 @@ function UserPanel(params) {
};
self.getLogoutButton().onclick = function(){
ServerConnector.logout().then(function(token){
ServerConnector.logout().then(function(){
window.location.reload(false);
}).catch(function(problem){
GuiConnector.alert(problem);
......@@ -88,7 +88,7 @@ UserPanel.prototype.showLoginPage = function() {
self.getUserLoginTab().style.display = "block";
self.getUserDataTab().style.display = "none";
}
};
UserPanel.prototype.showUserProfilePage = function(user) {
var self = this;
......@@ -100,6 +100,6 @@ UserPanel.prototype.showUserProfilePage = function(user) {
self.getNameValue().innerHTML = user.getName();
self.getSurnameValue().innerHTML = user.getSurname();
self.getEmailValue().innerHTML = user.getEmail();
}
};
module.exports = UserPanel;
"use strict";
var Project = require("../../main/js/map/data/Project");
var Promise = require("bluebird");
var Cookies = require('js-cookie');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment