-
Notifications
You must be signed in to change notification settings - Fork 0
Commit 6f81b7f
refactor(auth): add robust validation for role updates
Adds try-catch blocks around the byName() enum parsing for appRole and dashboardRole in the user updater logic. This prevents unhandled ArgumentError exceptions when a client provides an invalid role string.
Instead of causing a 500 Internal Server Error, the API will now correctly return a 400 Bad Request with a clear error message, improving client-side error handling and API robustness.1 parent 662bfe5 commit 6f81b7f
1 file changed
+18
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | - | ||
242 | - | ||
243 | - | ||
241 | + | ||
242 | + | ||
243 | + | ||
244 | + | ||
245 | + | ||
246 | + | ||
247 | + | ||
248 | + | ||
249 | + | ||
244 | 250 | | |
245 | 251 | | |
246 | 252 | | |
247 | 253 | | |
248 | - | ||
249 | - | ||
250 | - | ||
254 | + | ||
255 | + | ||
256 | + | ||
257 | + | ||
258 | + | ||
259 | + | ||
260 | + | ||
261 | + | ||
262 | + | ||
251 | 263 | | |
252 | 264 | | |
253 | 265 | | |
| |||
0 commit comments