Backend: - UserRecord Model + Users-Tabelle in DB - AuthService: SHA256-Passwort-Hashing, Token-Verwaltung (ConcurrentDictionary) - AuthMiddleware: Schützt alle /api/-Routes (außer /api/auth/login) - AuthEndpoint: Login, Logout, Me - Default-User admin/admin wird automatisch erstellt Frontend: - Login-Page mit Formular (Enter-Key-Support) - Globaler Fetch-Interceptor: 401 → automatisch Login-Redirect - Auth-Check beim App-Start und bei Hash-Änderungen - Logout-Link im Dashboard-Header - Login-CSS: Zentrierte Login-Box
13 lines
337 B
C#
13 lines
337 B
C#
namespace Gott.Models;
|
|
|
|
public class UserRecord
|
|
{
|
|
public int Id { get; set; }
|
|
public string UserId { get; set; }
|
|
public string Username { get; set; }
|
|
public string PasswordHash { get; set; }
|
|
public string DisplayName { get; set; }
|
|
public string CreatedAt { get; set; }
|
|
public string UpdatedAt { get; set; }
|
|
}
|