Fix user display, add logout, footer, optimize performance
- Move userDisplay inside tableContainer with proper positioning - Add logout button next to settings - Add footer with user email (left) and version (right) - Fix auth model loading on page refresh - Remove cache clearing on checkbox changes for better performance - Add 150ms debounce to search input - Expand search to include Notes fields - Suppress QUIC protocol console errors from realtime connection - Optimize checkbox change handler
This commit is contained in:
@@ -113,12 +113,12 @@ app.post('/api/admin/login', async (c) => {
|
||||
return c.json({ message: 'Missing email or password' }, 400);
|
||||
}
|
||||
|
||||
// Authenticate as PocketBase superuser via `_superusers` collection
|
||||
const authData = await pb.collection('_superusers').authWithPassword(email, password);
|
||||
// Authenticate as regular user
|
||||
const authData = await pb.collection('users').authWithPassword(email, password);
|
||||
if (!authData || !authData.token) {
|
||||
return c.json({ message: 'Invalid credentials' }, 401);
|
||||
}
|
||||
return c.json({ ok: true, token: authData.token, email: authData.record?.email, role: 'superuser' });
|
||||
return c.json({ ok: true, token: authData.token, email: authData.record?.email });
|
||||
} catch (err) {
|
||||
console.error('admin_login_error', { message: (err as Error)?.message });
|
||||
return c.json({ message: 'Login failed' }, 401);
|
||||
|
||||
Reference in New Issue
Block a user