Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ <h2 id="auth-title" style="margin:0 0 8px; font-size:22px; font-weight:700;">Wel

<input id="auth-password" type="password" placeholder="Password" style="width:100%; padding:12px; border:1px solid #ddd; border-radius:8px; font-size:14px; margin-bottom:20px; box-sizing:border-box;">

<input id="auth-confirm-password"
type="password"
placeholder="Confirm Password"
style="width:100%; padding:12px; border:1px solid #ddd; border-radius:8px; font-size:14px; margin-bottom:20px; box-sizing:border-box; display:none;">

<button id="auth-submit-btn" style="width:100%; padding:12px; background:#4f46e5; color:white; border:none; border-radius:8px; font-size:15px; font-weight:600; cursor:pointer;">
Sign In
</button>
Expand All @@ -44,7 +49,6 @@ <h2 id="auth-title" style="margin:0 0 8px; font-size:22px; font-weight:700;">Wel
<a id="auth-toggle-btn" href="#" style="color:#4f46e5; font-weight:600; margin-left:4px;">Sign Up</a>
</p>

<p id="auth-error" style="color:red; font-size:13px; text-align:center; margin:8px 0 0; display:none;"></p>
</div>
</div>

Expand Down Expand Up @@ -325,6 +329,7 @@ <h3 style="font-size:12px; font-weight:700; text-transform:uppercase; color:var(
document.getElementById('auth-submit-btn').textContent = isLogin ? 'Sign In' : 'Sign Up';
document.getElementById('auth-toggle-text').textContent = isLogin ? "Don't have an account?" : 'Already have an account?';
document.getElementById('auth-toggle-btn').textContent = isLogin ? 'Sign Up' : 'Sign In';
document.getElementById('auth-confirm-password').style.display = isLogin ? 'none' : 'block';
document.getElementById('auth-error').style.display = 'none';
});

Expand All @@ -347,6 +352,7 @@ <h3 style="font-size:12px; font-weight:700; text-transform:uppercase; color:var(

const email = document.getElementById('auth-email').value.trim();
const password = document.getElementById('auth-password').value.trim();
const confirmPassword = document.getElementById('auth-confirm-password').value.trim();
const errorEl = document.getElementById('auth-error');

errorEl.style.display = 'none';
Expand All @@ -365,6 +371,11 @@ <h3 style="font-size:12px; font-weight:700; text-transform:uppercase; color:var(
errorEl.style.display = 'block';
return;
}
if (!isLogin && password !== confirmPassword) {
errorEl.textContent = 'Passwords do not match';
errorEl.style.display = 'block';
return;
}

const endpoint = isLogin ? '/api/auth/login' : '/api/auth/signup';

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.