feat: multi-user auth with role-based access
Deploy HiHala Dashboard / deploy (push) Successful in 6s
Deploy HiHala Dashboard / deploy (push) Successful in 6s
- Server checks PIN against env (super admin) + NocoDB Users table - Session stores name + role (admin/viewer) - Admin: sees Settings page (seasons + users management) - Viewer: sees Dashboard + Comparison only, no Settings - Users CRUD on Settings page: add name + PIN + role, delete - Settings link + nav hidden for non-admin users Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
||||
import { useLanguage } from '../contexts/LanguageContext';
|
||||
|
||||
interface LoginProps {
|
||||
onLogin: () => void;
|
||||
onLogin: (name: string, role: string) => void;
|
||||
}
|
||||
|
||||
function Login({ onLogin }: LoginProps) {
|
||||
@@ -30,7 +30,8 @@ function Login({ onLogin }: LoginProps) {
|
||||
return;
|
||||
}
|
||||
|
||||
onLogin();
|
||||
const data = await res.json();
|
||||
onLogin(data.name || '', data.role || 'viewer');
|
||||
} catch {
|
||||
setError(t('login.error'));
|
||||
setLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user