Add global error handling middleware for API routes and enhance rating update logic

Implemented a global error handling middleware in the server to standardize error responses for API routes. Additionally, updated the AutoUpdateRatingsService to retrieve the approved user club before updating ratings, ensuring proper access control. Modified the error handling in MyTischtennisAccount.vue to provide more informative login failure messages.
This commit is contained in:
Torsten Schulz (local)
2025-11-07 13:22:22 +01:00
parent eba8ba30aa
commit 94aab93f7d
3 changed files with 48 additions and 3 deletions

View File

@@ -287,7 +287,7 @@ export default {
});
await this.loadAccount(); // Aktualisiere Account-Daten inkl. clubId, fedNickname
} catch (error) {
const message = error.response?.data?.message || 'Login fehlgeschlagen';
const message = error.response?.data?.message || error.response?.data?.error || error.message || 'Login fehlgeschlagen';
if (error.response?.status === 400 && message.includes('Kein Passwort gespeichert')) {
// Passwort-Dialog öffnen