summary refs log tree commit diff
path: root/src-slowcord/login/public/register.html
blob: 30b560a48f57e2caecf05fb8e9c679150f8d51e4 (plain) (blame)
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
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Slowcord</title>

		<link rel="preconnect" href="https://fonts.googleapis.com" />
		<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
		<link
			href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap"
			rel="stylesheet"
		/>

		<link rel="stylesheet" href="./css/index.css" />
		<script src="js/handler.js"></script>
	</head>

	<body>
		<div class="content">
			<div class="login">
				<div class="header">
					<h1>Welcome to Slowcord</h1>
					<div class="header-subtext">
						<p>You're new?</p>
						<a href="/login">Actually, I'm not!</a>
					</div>

					<p id="failure">Register failed</p>
				</div>

				<form action="javascript:void(0);">
					<label for="email">Email</label>
					<input type="email" name="email" />

					<label for="username">Username</label>
					<input type="username" name="username" />

					<label for="password">Password</label>
					<input type="password" name="password" />

					<label for="dob">Date of Birth</label>
					<input type="date" name="dob" />

					<input type="submit" value="Register" />

					<a
						id="loginDiscord"
						class="oauth"
						href="https://discord.com/api/oauth2/authorize?client_id=991688571415175198&redirect_uri=https%3A%2F%2Fslowcord.maddy.k.vu%2Foauth%2Fdiscord&response_type=code&scope=identify%20email"
					>
						Login with Discord
					</a>

					<div
						class="h-captcha"
						data-sitekey="fa3163ea-79a7-4b7b-b752-b58c545906c8"
					></div>
					<script
						src="https://js.hcaptcha.com/1/api.js"
						async
						defer
					></script>
				</form>
			</div>
		</div>

		<script>
			document.forms[0].addEventListener("submit", async (e) => {
				const data = new FormData(e.target);
				const email = data.get("email");
				const username = data.get("username");
				const password = data.get("password");
				const dob = data.get("dob");
				const hcaptcha = data.get("h-captcha-response");

				await handleSubmit("/api/v9/auth/register", {
					consent: true,
					email: email,
					username: username,
					password: password,
					date_of_birth: dob,
					captcha_key: hcaptcha,
				});
			});
		</script>
	</body>
</html>