Refactoring, regression testing until Phase 1 end.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import LoginForm from '$lib/components/Auth/LoginForm.svelte';
|
||||
import { login, auth } from '$lib/stores/auth';
|
||||
import { login, isLoading, authError, clearAuthError } from '$lib/stores/auth';
|
||||
import { LayoutDashboard } from 'lucide-svelte';
|
||||
|
||||
async function handleLogin(event: CustomEvent<{ email: string; password: string }>) {
|
||||
const { email, password } = event.detail;
|
||||
clearAuthError();
|
||||
|
||||
const result = await login({ email, password });
|
||||
|
||||
if (result.success) {
|
||||
@@ -40,8 +42,8 @@
|
||||
|
||||
<LoginForm
|
||||
on:login={handleLogin}
|
||||
isLoading={$auth.isLoading}
|
||||
errorMessage={$auth.error}
|
||||
isLoading={$isLoading}
|
||||
errorMessage={$authError}
|
||||
/>
|
||||
|
||||
<div class="divider text-base-content/40 text-sm">Demo Access</div>
|
||||
|
||||
Reference in New Issue
Block a user