feat(auth): implement user authentication and profile management

- Added authentication context and provider to manage user state.
- Created login and registration forms with validation and error handling.
- Implemented user profile component for updating user information and changing passwords.
- Introduced user settings in the database for notification preferences.
- Updated translations for authentication-related strings in English and German.
- Enhanced styles for authentication components and user profile.
- Added middleware for optional and required authentication checks.
This commit is contained in:
Daniel Volz
2025-12-26 19:57:35 +01:00
parent 5900fddb2d
commit a7f9f90db4
20 changed files with 2020 additions and 402 deletions
+38
View File
@@ -56,6 +56,8 @@
"pills": "Tabletten",
"days": "Tage",
"currentPills": "Aktuelle Tabletten",
"fullBlisters": "Volle Blister",
"openBlister": "Offener Blister",
"daysLeft": "Tage übrig",
"status": "Bestand",
"runsOut": "Aufgebraucht",
@@ -216,6 +218,35 @@
"takenBy": "eingenommen von",
"markAsTaken": "Als eingenommen markieren"
},
"auth": {
"login": "Anmelden",
"logout": "Abmelden",
"register": "Konto erstellen",
"createAdmin": "Admin-Konto erstellen",
"profile": "Profil",
"username": "Benutzername",
"password": "Passwort",
"email": "E-Mail",
"confirmPassword": "Passwort bestätigen",
"currentPassword": "Aktuelles Passwort",
"newPassword": "Neues Passwort",
"changePassword": "Passwort ändern",
"forgotPassword": "Passwort vergessen?",
"sendResetLink": "Link senden",
"resetPassword": "Passwort zurücksetzen",
"backToLogin": "Zurück zur Anmeldung",
"createAccount": "Konto erstellen",
"alreadyHaveAccount": "Bereits ein Konto? Anmelden",
"firstUserInfo": "Dies wird das Administrator-Konto.",
"usernameHint": "Nur Buchstaben, Zahlen, Unterstriche und Bindestriche",
"emailHint": "Für Passwort-Wiederherstellung",
"passwordMismatch": "Passwörter stimmen nicht überein",
"checkEmail": "E-Mail überprüfen",
"resetEmailSent": "Falls ein Konto mit dieser E-Mail existiert, haben wir einen Link zum Zurücksetzen gesendet.",
"passwordReset": "Passwort zurückgesetzt",
"passwordResetSuccess": "Ihr Passwort wurde zurückgesetzt. Weiterleitung zur Anmeldung...",
"profileUpdated": "Profil erfolgreich aktualisiert"
},
"common": {
"loading": "Wird geladen...",
"sending": "Wird gesendet...",
@@ -233,9 +264,16 @@
"optional": "optional",
"pill": "Tablette",
"pills": "Tabletten",
"of": "von",
"loose": "lose",
"none": "Kein",
"day": "Tag",
"days": "Tage",
"blister": "Blister",
"blisters": "Blister",
"fullBlister": "voller Blister",
"fullBlisters": "volle Blister",
"inBlister": "in 1 Blister",
"total": "gesamt"
}
}
+38
View File
@@ -58,6 +58,8 @@
"pills": "Pills",
"days": "Days",
"currentPills": "Current pills",
"fullBlisters": "Full blisters",
"openBlister": "Open blister",
"daysLeft": "Days left",
"status": "Stock",
"runsOut": "Runs out",
@@ -218,6 +220,35 @@
"takenBy": "taken by",
"markAsTaken": "Mark as taken"
},
"auth": {
"login": "Login",
"logout": "Logout",
"register": "Create Account",
"createAdmin": "Create Admin Account",
"profile": "Profile",
"username": "Username",
"password": "Password",
"email": "Email",
"confirmPassword": "Confirm Password",
"currentPassword": "Current Password",
"newPassword": "New Password",
"changePassword": "Change Password",
"forgotPassword": "Forgot password?",
"sendResetLink": "Send Reset Link",
"resetPassword": "Reset Password",
"backToLogin": "Back to Login",
"createAccount": "Create account",
"alreadyHaveAccount": "Already have an account? Login",
"firstUserInfo": "This will be the administrator account.",
"usernameHint": "Letters, numbers, underscores, and hyphens only",
"emailHint": "For password recovery",
"passwordMismatch": "Passwords do not match",
"checkEmail": "Check your email",
"resetEmailSent": "If an account with this email exists, we've sent a password reset link.",
"passwordReset": "Password Reset",
"passwordResetSuccess": "Your password has been reset. Redirecting to login...",
"profileUpdated": "Profile updated successfully"
},
"common": {
"loading": "Loading...",
"sending": "Sending...",
@@ -235,9 +266,16 @@
"optional": "optional",
"pill": "pill",
"pills": "pills",
"of": "of",
"loose": "loose",
"none": "None",
"day": "day",
"days": "days",
"blister": "blister",
"blisters": "blisters",
"fullBlister": "full blister",
"fullBlisters": "full blisters",
"inBlister": "in 1 blister",
"total": "total"
}
}