2016-02-16 23:43:09 -08:00
|
|
|
module.exports = options => {
|
|
|
|
|
if (!options) {
|
|
|
|
|
throw "Options were not provided"
|
|
|
|
|
}
|
2016-09-18 18:32:34 -04:00
|
|
|
let adapter = {
|
2016-02-23 21:05:27 -05:00
|
|
|
sendVerificationEmail: () => Promise.resolve(),
|
2016-02-27 10:51:12 -05:00
|
|
|
sendPasswordResetEmail: () => Promise.resolve(),
|
2016-02-23 21:05:27 -05:00
|
|
|
sendMail: () => Promise.resolve()
|
2016-09-18 18:32:34 -04:00
|
|
|
};
|
|
|
|
|
if (options.sendMail) {
|
|
|
|
|
adapter.sendMail = options.sendMail
|
2016-02-16 23:43:09 -08:00
|
|
|
}
|
2016-09-18 18:32:34 -04:00
|
|
|
if (options.sendPasswordResetEmail) {
|
|
|
|
|
adapter.sendPasswordResetEmail = options.sendPasswordResetEmail
|
|
|
|
|
}
|
|
|
|
|
if (options.sendVerificationEmail) {
|
|
|
|
|
adapter.sendVerificationEmail = options.sendVerificationEmail;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return adapter;
|
2016-02-16 23:43:09 -08:00
|
|
|
}
|