-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
91 lines (83 loc) · 2.46 KB
/
index.html
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!--B"H-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign In to Shlichus</title>
<link rel="manifest" href="./manifest.json">
<meta name="theme-color" content="#000000">
<script src="./servicer.js"></script>
<link rel="stylesheet" type="text/css" href="./style.css">
</head>
<body>
<div class="container">
<div class="profile img-container">
<img src="./img/profile.png">
</div>
<div id="errorMsg">
</div>
<div class="input-holder">
<div class="label">Email</div>
<input type="text" id="email" class="input-field" placeholder="Enter email here">
</div>
<div class="input-holder">
<div class="label">Password</div>
<input type="password" id="password" class="input-field" placeholder="Enter Password here">
</div>
<!-- Button -->
<div class="button btn" id="login">Login</div>
<div class="logo img-container"><img src="./img/logo.png"></div>
<div class="button btn" id="signup">Sign Up</div>
</div>
<script src="./signin.js"></script>
<script>
var baseURL = "https://awtsmoos.whf.bz";
console.log('B\"H', "\n\n\n")
var sign = document.getElementById("login");
var up = document.getElementById("signup");
if(up) {
up.onclick = () => {
location.href="signup.html";
}
}
if(sign) {
sign.onclick = async () => {
var log = await (
await fetch(
baseURL, {
method: "POST",
body: new URLSearchParams({
action: "login",
email: email.value,
password: password.value
})
}
)
).json();
console.log(sign);
if(log?.success)
location.href = "./settings.html";
else {
errorMsg.innerText = "Could not log in. " +
log?.error || "";
}
}
}
(async () => {
return
var sesh = await (
await fetch(baseURL, {
method: "POST",
body:new URLSearchParams({
action: "session"
})
})
).json();
if(sesh.success) {
location.href = "./settings.html"
}
})();
</script>
</body>
</html>