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

isSessionValid handles errors properly

parent 2ddb5fab
......@@ -174,11 +174,15 @@ ServerConnector.sendGetRequest = function (url, description) {
});
};
/**
*
* @return {Promise<boolean>}
*/
ServerConnector.isSessionValid = function () {
var self = this;
return self._sendRequest({url: this.isSessionValidUrl()}).then(function () {
return true;
}).catch(function (e) {
}).catch(function (error) {
if (error instanceof NetworkError) {
if (error.statusCode === HttpStatus.FORBIDDEN || error.statusCode === HttpStatus.UNAUTHORIZED) {
return false;
......
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