(req)
| 523 | } |
| 524 | |
| 525 | _throwOnBadEmailConfig(req) { |
| 526 | try { |
| 527 | Config.validateEmailConfiguration({ |
| 528 | emailAdapter: req.config.userController.adapter, |
| 529 | appName: req.config.appName, |
| 530 | publicServerURL: req.config.publicServerURL || req.config._publicServerURL, |
| 531 | emailVerifyTokenValidityDuration: req.config.emailVerifyTokenValidityDuration, |
| 532 | emailVerifyTokenReuseIfValid: req.config.emailVerifyTokenReuseIfValid, |
| 533 | }); |
| 534 | } catch (e) { |
| 535 | if (typeof e === 'string') { |
| 536 | // Maybe we need a Bad Configuration error, but the SDKs won't understand it. For now, Internal Server Error. |
| 537 | throw new Parse.Error( |
| 538 | Parse.Error.INTERNAL_SERVER_ERROR, |
| 539 | 'An appName, publicServerURL, and emailAdapter are required for password reset and email verification functionality.' |
| 540 | ); |
| 541 | } else { |
| 542 | throw e; |
| 543 | } |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | async handleResetRequest(req) { |
| 548 | this._throwOnBadEmailConfig(req); |
no test coverage detected