feat: Task 2 - Authentication & Authorization (Aflaha A) - #3
Conversation
| if (!validRoles.includes(role)) | ||
| return res | ||
| .status(400) | ||
| .json({ error: "Role must be one of: dev, lead, admin" }); |
There was a problem hiding this comment.
From a security perspective, try not to expose the internals like this. Generalise the error to something like "Invalid Token Error"/"Unauthorized" etc.
|
Hey, we have gone through your submission and would like to emphasise a few improvements. Considering this is a securtiy module, from a security perspective, try not to expose specific errors unless its strictly for testing and debugging(which also should be highly maintained), looking from what we see, a much more loose couple architecture would help with the debugging. Also, try to reduce the use of plaintext SQL queries embedded in the code, try migrating your code from plaintext to use ORM models from sequelize or similar frameworks. The final decision will be notified, Stay tuned! |
oki |
|
Ok, looks good. |
Task 2 — Authentication & Authorization
What's implemented
dev,lead,adminStack
How to run
See README.md