(verifyOptions)
| 859 | }; |
| 860 | |
| 861 | function assertVerifyOptions(verifyOptions) { |
| 862 | assert(verifyOptions.type, 'You must supply a verification type (verifyOptions.type)'); |
| 863 | assert(verifyOptions.type === 'email', 'Unsupported verification type'); |
| 864 | assert(verifyOptions.to, 'Must include verifyOptions.to when calling user.verify() ' + |
| 865 | 'or the user must have an email property'); |
| 866 | assert(verifyOptions.from, 'Must include verifyOptions.from when calling user.verify()'); |
| 867 | assert(typeof verifyOptions.templateFn === 'function', |
| 868 | 'templateFn must be a function'); |
| 869 | assert(typeof verifyOptions.generateVerificationToken === 'function', |
| 870 | 'generateVerificationToken must be a function'); |
| 871 | assert(verifyOptions.mailer, 'A mailer function must be provided'); |
| 872 | assert(typeof verifyOptions.mailer.send === 'function', 'mailer.send must be a function '); |
| 873 | } |
| 874 | |
| 875 | function createVerificationEmailBody(verifyOptions, options, cb) { |
| 876 | const template = loopback.template(verifyOptions.template); |
no outgoing calls
no test coverage detected
searching dependent graphs…