Add login success/failure feedback message
Shows "Logged in successfully!" or "Login failed" after clicking the managed mode Login button. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -257,15 +257,20 @@
|
|||||||
|
|
||||||
const MANAGED_SERVER_URL = "https://transcribe.shadowdao.com";
|
const MANAGED_SERVER_URL = "https://transcribe.shadowdao.com";
|
||||||
|
|
||||||
|
let loginMessage = $state("");
|
||||||
|
|
||||||
async function handleManagedLogin() {
|
async function handleManagedLogin() {
|
||||||
|
loginMessage = "";
|
||||||
try {
|
try {
|
||||||
await backendStore.apiPost("/api/login", {
|
await backendStore.apiPost("/api/login", {
|
||||||
email: managedEmail,
|
email: managedEmail,
|
||||||
password: managedPassword,
|
password: managedPassword,
|
||||||
server_url: remoteServerUrl || MANAGED_SERVER_URL,
|
server_url: remoteServerUrl || MANAGED_SERVER_URL,
|
||||||
});
|
});
|
||||||
|
loginMessage = "Logged in successfully!";
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Login failed:", err);
|
console.error("Login failed:", err);
|
||||||
|
loginMessage = "Login failed. Check your email and password.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,6 +509,11 @@
|
|||||||
<div class="auth-buttons">
|
<div class="auth-buttons">
|
||||||
<button onclick={handleManagedLogin}>Login</button>
|
<button onclick={handleManagedLogin}>Login</button>
|
||||||
</div>
|
</div>
|
||||||
|
{#if loginMessage}
|
||||||
|
<p style="font-size: 12px; margin-top: 6px; color: {loginMessage.startsWith('Logged') ? 'var(--accent-green, #4CAF50)' : 'var(--accent-red, #f44336)'};">
|
||||||
|
{loginMessage}
|
||||||
|
</p>
|
||||||
|
{/if}
|
||||||
<p style="font-size: 11px; color: var(--text-muted); margin-top: 8px;">
|
<p style="font-size: 11px; color: var(--text-muted); margin-top: 8px;">
|
||||||
Don't have an account? <a href="https://transcribe.shadowdao.com/register.html" target="_blank" rel="noopener" style="color: var(--accent-blue);">Sign up here</a>
|
Don't have an account? <a href="https://transcribe.shadowdao.com/register.html" target="_blank" rel="noopener" style="color: var(--accent-blue);">Sign up here</a>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user