Commit 80d4dd91 authored by Aleksandr Gumroian's avatar Aleksandr Gumroian 🚀
Browse files

Merge branch 'fix-ios-redirect-loop' into 'dev'

Fix iOS redirect loop

Closes #19

See merge request !154
parents adc6bbca 7f82b2e7
Pipeline #79262 passed with stages
in 3 minutes
This diff is collapsed.
/*
* Copyright (C) 2020 CZ.NIC z.s.p.o. (http://www.nic.cz/)
* Copyright (C) 2020-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/)
*
* This is free software, licensed under the GNU General Public License v3.
* See /LICENSE for more information.
......@@ -7,8 +7,6 @@
/* eslint no-console: "off" */
import { ForisURLs } from "../utils/forisUrls";
const PROTOCOL = window.location.protocol === "http:" ? "ws" : "wss";
const URL = process.env.LIGHTTPD
......@@ -21,13 +19,7 @@ export class WebSockets {
constructor() {
this.ws = new WebSocket(URL);
this.ws.onerror = (e) => {
if (window.location.pathname !== ForisURLs.login) {
console.error(
"WS: Error observed, you aren't logged probably."
);
window.location.replace(ForisURLs.login);
}
console.error(`WS: Error: ${e}`);
console.error("WS: Error observed:", e);
};
this.ws.onmessage = (e) => {
console.debug(`WS: Received Message: ${e.data}`);
......
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