-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth-failed.js
More file actions
34 lines (27 loc) · 857 Bytes
/
Copy pathauth-failed.js
File metadata and controls
34 lines (27 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const socket = io();
// Check local auth first
let auth = localStorage.getItem("auth") === 'true';
if (auth) {
window.location.replace("/fileshare.htm");
}
document.addEventListener('DOMContentLoaded', function () {
// Socket auth listener
socket.on("auth", (data) => {
auth = data === 'true';
localStorage.setItem("auth", data);
if (auth) {
window.location.replace("/fileshare.htm");
}
});
// Buttons
const link = document.getElementById('link');
const reload_btn = document.getElementById('reload');
if (reload_btn) {
reload_btn.addEventListener('click', () => window.location.replace('/loader.htm'));
}
if (link) {
link.addEventListener('click', () => {
alert("Go to web: http://localhost:3000/login/login.htm");
});
}
});