roles based access added
This commit is contained in:
parent
90d892090d
commit
6c9a6d60a2
@ -1,7 +1,6 @@
|
|||||||
import { useState, type FormEvent } from 'react';
|
import { useState, type FormEvent } from 'react';
|
||||||
import { Navigate, useNavigate } from 'react-router-dom';
|
import { Navigate, useNavigate } from 'react-router-dom';
|
||||||
import { useAuth } from '../auth/context';
|
import { useAuth } from '../auth/context';
|
||||||
import { APP_ID } from '../api/config';
|
|
||||||
import { Button } from '../components/buttons';
|
import { Button } from '../components/buttons';
|
||||||
import { Card, Input } from '../components/reusable';
|
import { Card, Input } from '../components/reusable';
|
||||||
|
|
||||||
@ -11,7 +10,6 @@ export function LoginPage() {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [email, setEmail] = useState('');
|
const [email, setEmail] = useState('');
|
||||||
const [password, setPassword] = useState('');
|
const [password, setPassword] = useState('');
|
||||||
const [orgId, setOrgId] = useState('');
|
|
||||||
const [busy, setBusy] = useState(false);
|
const [busy, setBusy] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
@ -22,7 +20,7 @@ export function LoginPage() {
|
|||||||
setBusy(true);
|
setBusy(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
try {
|
try {
|
||||||
await login(email, password, orgId || undefined);
|
await login(email, password);
|
||||||
navigate('/daily', { replace: true });
|
navigate('/daily', { replace: true });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError((err as { message?: string })?.message ?? 'Login failed');
|
setError((err as { message?: string })?.message ?? 'Login failed');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user