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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user