feat: Refactor Filament resources and fix tenant admin login
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
export async function login(email: string, password: string): Promise<{ token: string }> {
|
||||
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.getAttribute('content');
|
||||
const res = await fetch('/api/v1/tenant/login', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': csrfToken || '',
|
||||
},
|
||||
body: JSON.stringify({ email, password }),
|
||||
});
|
||||
if (!res.ok) throw new Error('Login failed');
|
||||
|
||||
Reference in New Issue
Block a user