Commit a320459
authored
docs(function): return results directly in managing-idp-users samples (#156)
* docs(function): return results directly in managing-idp-users samples
The `tailor.idp` client methods reject on failure, so wrapping their
results in a `{ success }` object made the samples read as if they
presuppose try/catch-based error handling — and implicitly recommended
returning a result object. Return the meaningful value directly and let
errors propagate as thrown exceptions, so the samples reflect the
recommended "throw unless you need to control the error or its message"
style rather than a success/error result object.
* docs(function): drop redundant return await and report only unenrolled factors
Apply Copilot review feedback on the managing-idp-users samples.
- Drop the redundant `await` from the `deleteUser`, `sendPasswordResetEmail`,
and single-factor `unenrollMfa` samples. With no surrounding `try`/`catch`,
returning the promise directly is equivalent and reads more simply.
- In the reset-all-MFA sample, filter `user.mfaFactorIds` by the boolean
results of `unenrollMfa()` so `unenrolledFactorIds` reflects the factors
that were actually unenrolled, rather than assuming every factor succeeded.1 parent 82a8b0f commit a320459
1 file changed
Lines changed: 8 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | 217 | | |
219 | 218 | | |
220 | 219 | | |
| |||
238 | 237 | | |
239 | 238 | | |
240 | 239 | | |
241 | | - | |
242 | 240 | | |
243 | 241 | | |
244 | 242 | | |
| |||
264 | 262 | | |
265 | 263 | | |
266 | 264 | | |
267 | | - | |
268 | 265 | | |
269 | 266 | | |
270 | 267 | | |
| |||
283 | 280 | | |
284 | 281 | | |
285 | 282 | | |
286 | | - | |
287 | 283 | | |
288 | 284 | | |
289 | 285 | | |
| |||
297 | 293 | | |
298 | 294 | | |
299 | 295 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
| 296 | + | |
305 | 297 | | |
306 | 298 | | |
307 | 299 | | |
| |||
313 | 305 | | |
314 | 306 | | |
315 | 307 | | |
316 | | - | |
| 308 | + | |
317 | 309 | | |
318 | 310 | | |
319 | 311 | | |
320 | 312 | | |
321 | 313 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | 314 | | |
327 | 315 | | |
328 | 316 | | |
| |||
346 | 334 | | |
347 | 335 | | |
348 | 336 | | |
349 | | - | |
| 337 | + | |
350 | 338 | | |
351 | 339 | | |
352 | 340 | | |
353 | | - | |
354 | 341 | | |
355 | 342 | | |
356 | 343 | | |
| |||
361 | 348 | | |
362 | 349 | | |
363 | 350 | | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | 351 | | |
368 | 352 | | |
369 | 353 | | |
370 | 354 | | |
371 | 355 | | |
372 | 356 | | |
373 | 357 | | |
374 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
375 | 363 | | |
376 | 364 | | |
377 | 365 | | |
| |||
0 commit comments