Add cash management schema and immediate variance alerts
This commit is contained in:
@@ -10,8 +10,8 @@ interface LoginPageProps {
|
||||
}
|
||||
|
||||
export const LoginPage = ({ onLogin }: LoginPageProps) => {
|
||||
const [email, setEmail] = useState('admin@astra.in');
|
||||
const [password, setPassword] = useState('123456');
|
||||
const [email, setEmail] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const { signIn } = useAuth();
|
||||
@@ -21,13 +21,10 @@ export const LoginPage = ({ onLogin }: LoginPageProps) => {
|
||||
e.preventDefault();
|
||||
setLoading(true);
|
||||
|
||||
console.log('Attempting login with:', { email, password });
|
||||
|
||||
try {
|
||||
const { error } = await signIn(email, password);
|
||||
|
||||
if (error) {
|
||||
console.error('Login error:', error);
|
||||
toast({
|
||||
title: "Login Error",
|
||||
description: error.message,
|
||||
@@ -43,7 +40,6 @@ export const LoginPage = ({ onLogin }: LoginPageProps) => {
|
||||
|
||||
onLogin();
|
||||
} catch (err) {
|
||||
console.error('Unexpected error:', err);
|
||||
toast({
|
||||
title: "Error",
|
||||
description: "An unexpected error occurred",
|
||||
@@ -83,7 +79,7 @@ export const LoginPage = ({ onLogin }: LoginPageProps) => {
|
||||
<div>
|
||||
<Input
|
||||
type="email"
|
||||
placeholder="admin@astra.in"
|
||||
placeholder="Email address"
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
className="w-full h-12 px-4 border border-gray-300 rounded-lg focus:border-purple-500 focus:ring-purple-500"
|
||||
|
||||
Reference in New Issue
Block a user