roles based access added

This commit is contained in:
suryacp23 2026-07-30 11:56:55 +05:30
parent 90d892090d
commit 6c9a6d60a2

View File

@ -1,7 +1,6 @@
import { useState, type FormEvent } from 'react';
import { Navigate, useNavigate } from 'react-router-dom';
import { useAuth } from '../auth/context';
import { APP_ID } from '../api/config';
import { Button } from '../components/buttons';
import { Card, Input } from '../components/reusable';
@ -11,7 +10,6 @@ export function LoginPage() {
const navigate = useNavigate();
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [orgId, setOrgId] = useState('');
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
@ -22,7 +20,7 @@ export function LoginPage() {
setBusy(true);
setError(null);
try {
await login(email, password, orgId || undefined);
await login(email, password);
navigate('/daily', { replace: true });
} catch (err) {
setError((err as { message?: string })?.message ?? 'Login failed');