69 lines
3.2 KiB
HTML
69 lines
3.2 KiB
HTML
<!doctype html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<link rel="stylesheet" href="./style/output.css" />
|
|
<link rel="stylesheet" href="./style/auth-pages.css" />
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Noto+Sans+KR:wght@400;700&display=swap" rel="stylesheet" />
|
|
<title>로그인 - UNIARE</title>
|
|
</head>
|
|
<body class="auth-page">
|
|
<nav class="auth-nav">
|
|
<div class="auth-nav-inner">
|
|
<a href="/" class="auth-brand">
|
|
<img src="/images/assets/uniare-h48.png" alt="UNIARE" class="app-brand-logo" height="32" />
|
|
</a>
|
|
</div>
|
|
</nav>
|
|
|
|
<main class="auth-main">
|
|
<header class="auth-header">
|
|
<h1 data-i18n="loginPageTitle">로그인</h1>
|
|
<p data-i18n-html="loginPageDesc">덱을 저장하고 관리하려면<br />계정으로 로그인하세요.</p>
|
|
</header>
|
|
|
|
<form id="login-form" class="auth-card">
|
|
<div class="auth-field">
|
|
<label class="auth-label" for="email" data-i18n="emailLabel">이메일</label>
|
|
<input type="email" id="email" required class="auth-input" placeholder="you@example.com" autocomplete="email" />
|
|
</div>
|
|
<div class="auth-field">
|
|
<label class="auth-label" for="password" data-i18n="passwordLabel">비밀번호</label>
|
|
<input type="password" id="password" required class="auth-input" placeholder="••••••••" autocomplete="current-password" />
|
|
</div>
|
|
<p id="error-msg" class="auth-error hidden"></p>
|
|
<button type="submit" class="auth-submit" data-i18n="loginButton">로그인</button>
|
|
</form>
|
|
|
|
<p class="auth-footer">
|
|
<span data-i18n="noAccount">계정이 없으신가요?</span>
|
|
<a href="/signup.html" data-i18n="authSignup">회원가입</a>
|
|
</p>
|
|
</main>
|
|
|
|
<footer class="auth-version-footer" aria-hidden="true">v4.0.1</footer>
|
|
|
|
<script src="/script/page-i18n.js"></script>
|
|
<script src="/script/api.js"></script>
|
|
<script>
|
|
document.getElementById('login-form').addEventListener('submit', async (e) => {
|
|
e.preventDefault();
|
|
const errEl = document.getElementById('error-msg');
|
|
errEl.classList.add('hidden');
|
|
try {
|
|
const email = document.getElementById('email').value;
|
|
const password = document.getElementById('password').value;
|
|
const { token, user } = await UaDeckApi.login(email, password);
|
|
UaDeckApi.saveAuth(token, user);
|
|
const redirect = new URLSearchParams(location.search).get('redirect') || '/';
|
|
location.href = redirect;
|
|
} catch (err) {
|
|
errEl.textContent = err.message;
|
|
errEl.classList.remove('hidden');
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|