Repository navigation
Expand file tree
/
Copy pathsignup.html
More file actions
54 lines (47 loc) · 1.53 KB
/
Copy pathsignup.html
File metadata and controls
54 lines (47 loc) · 1.53 KB
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
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>[회원가입] 화면</title>
</head>
<body>
<h1>[회원가입] 화면</h1>
<nav>
<a href="/testpages/index.html">홈</a> |
<a href="/testpages/signup.html">회원가입</a> |
<a href="/testpages/login.html">로그인</a> |
<a href="/testpages/drinks.html">내 음료</a> |
<a href="/testpages/presets.html">프리셋</a> |
<a href="/testpages/caffeine_logs.html">섭취기록</a> |
<a href="/testpages/sleep_logs.html">수면기록</a> |
<a href="/testpages/profile.html">프로필</a> |
<a href="/testpages/feed_status.html">피드계산</a> |
<a href="/testpages/night_session.html">밤샘모드</a> |
<button onclick="doLogout()">로그아웃</button>
[<span id="auth-status">확인중...</span>]
</nav>
<hr>
<h2>POST /auth/signup/</h2>
<form id="signup-form">
<label>username <input type="text" name="username" required></label><br><br>
<label>password <input type="password" name="password" required></label><br><br>
<button type="submit">가입</button>
</form>
<h3>응답</h3>
<pre id="signup-result">(아직 요청 없음)</pre>
<script src="common.js"></script>
<script>
initNav();
document.getElementById("signup-form").addEventListener("submit", async (e) => {
e.preventDefault();
const fd = new FormData(e.target);
const result = await apiFetch("/auth/signup/", "POST", {
username: fd.get("username"),
password: fd.get("password"),
});
renderResult("signup-result", result);
initNav();
});
</script>
</body>
</html>