Code quality improvements from code review
- Add admin-only authorization for company and projects CRUD operations - Create requireAccountId middleware to eliminate code duplication - Standardize error handling (use next(error) consistently) - Change error messages to Slovak language 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -57,7 +57,7 @@ export const login = async (req, res, next) => {
|
||||
// Log failed login
|
||||
await logLoginAttempt(username, false, ipAddress, userAgent, error.message);
|
||||
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@ export const setPassword = async (req, res, next) => {
|
||||
message: 'Heslo úspešne nastavené',
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -114,7 +114,7 @@ export const linkEmail = async (req, res, next) => {
|
||||
message: 'Email účet úspešne pripojený a overený',
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -135,7 +135,7 @@ export const skipEmail = async (req, res, next) => {
|
||||
message: 'Email setup preskočený',
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -164,7 +164,7 @@ export const logout = async (req, res, next) => {
|
||||
message: result.message,
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -183,7 +183,7 @@ export const getSession = async (req, res, next) => {
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -201,6 +201,6 @@ export const getMe = async (req, res, next) => {
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
return next(error);
|
||||
next(error);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user