megacommit
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<body>
|
||||
<div class="signup-container">
|
||||
<div class="signup-header">
|
||||
<div class="logo">DC</div>
|
||||
<img src="/static/favicon.ico" class="logo"/>
|
||||
<h1>Login</h1>
|
||||
<p>Enter the chat</p>
|
||||
</div>
|
||||
@@ -98,7 +98,7 @@
|
||||
// Disable button and show loading
|
||||
submitButton.disabled = true;
|
||||
submitButton.innerHTML =
|
||||
'<span class="loading-spinner"></span>Creating Account...';
|
||||
'<span class="loading-spinner"></span>Logging In...';
|
||||
|
||||
// Prepare data
|
||||
const formData = {
|
||||
@@ -124,14 +124,12 @@
|
||||
successMessage.classList.add("show");
|
||||
submitButton.innerHTML = "Logged in!!";
|
||||
|
||||
// Optional: Redirect after success
|
||||
setTimeout(() => {
|
||||
window.location.href = '/chat';
|
||||
// console.log("Redirecting to chat...");
|
||||
}, 2000);
|
||||
window.location.replace('/chat');
|
||||
}, 1000);
|
||||
} else {
|
||||
const error = await response.json();
|
||||
throw new Error(error.message || "Login failed");
|
||||
const error = await response.text();
|
||||
throw new Error(error || "Login failed");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Login error:", error);
|
||||
|
||||
Reference in New Issue
Block a user