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

Merge branch '892-minervanet-error-report-96' into 'master'

Resolve "MINERVANET - Error Report 96"

Closes #892

See merge request minerva/core!892
parents cb056fa6 fcd7cd68
Pipeline #13004 passed with stage
in 12 minutes and 19 seconds
minerva (14.0.0~beta.0) unstable; urgency=low
* Bug fix: work on FF Private Window mode could cause logout or raise an
error on when opening new tab with minerva (#892)
* Bug fix: fetching list of miRnas resulted sometimes in "Internal Server
Error" (#889)
* Bug fix: user without admin right can accept terms of service (#893)
......
......@@ -182,7 +182,16 @@ ServerConnector.sendGetRequest = function (url, description) {
ServerConnector.isSessionValid = function () {
var self = this;
return self._sendRequest({method: "GET", url: this.isSessionValidUrl()}).then(function (content) {
return JSON.parse(content).login === self.getSessionData(null).getLogin();
var sessionLogin = self.getSessionData(null).getLogin();
var serverSideLogin = JSON.parse(content).login;
//this is workaround for the problem with Firefox Private Window issue
//in FF new tab is opened with existing cookies but localStorage is cleared
if (sessionLogin === undefined || sessionLogin === null) {
console.log("SET USER");
self.getSessionData(null).setLogin(serverSideLogin);
}
return serverSideLogin === self.getSessionData(null).getLogin();
}).catch(function (error) {
if (error instanceof NetworkError) {
if (error.statusCode === HttpStatus.FORBIDDEN || error.statusCode === HttpStatus.UNAUTHORIZED) {
......
......@@ -272,7 +272,7 @@ SessionData.prototype.getZoomLevel = function (model) {
/**
* TODO remove this method
* @param {string} token
* @param {?null|string} token
*/
SessionData.prototype.setToken = function (token) {
var key = SessionObjectType.TOKEN;
......@@ -294,7 +294,7 @@ SessionData.prototype.getToken = function () {
/**
*
* @param {string} login
* @param {?null|string} login
*/
SessionData.prototype.setLogin = function (login) {
var key = SessionObjectType.LOGIN;
......@@ -307,7 +307,7 @@ SessionData.prototype.setLogin = function (login) {
/**
*
* @returns {string}
* @returns {?null|string}
*/
SessionData.prototype.getLogin = function () {
var key = SessionObjectType.LOGIN;
......
Supports Markdown
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