feat: mock-email and some fixes for email auth
This commit is contained in:
parent
ab304093f3
commit
c173f241eb
10 changed files with 97 additions and 26 deletions
|
|
@ -763,7 +763,7 @@ function plugins (settings, deviceId) {
|
|||
function getPhoneCode (phone) {
|
||||
const notifications = configManager.getNotifications(settings.config)
|
||||
|
||||
const code = notifications.thirdParty_sms === 'mock-sms'
|
||||
const code = settings.config.notifications_thirdParty_sms === 'mock-sms'
|
||||
? '123'
|
||||
: randomCode()
|
||||
|
||||
|
|
@ -780,13 +780,11 @@ function plugins (settings, deviceId) {
|
|||
}
|
||||
|
||||
function getEmailCode (toEmail) {
|
||||
const notifications = configManager.getNotifications(settings.config)
|
||||
|
||||
const code = notifications.thirdParty_email === 'mock-email'
|
||||
const code = settings.config.notifications_thirdParty_email === 'mock-email'
|
||||
? '123'
|
||||
: randomCode()
|
||||
|
||||
const req = {
|
||||
const rec = {
|
||||
email: {
|
||||
toEmail,
|
||||
subject: 'Your cryptomat code',
|
||||
|
|
@ -794,10 +792,8 @@ function plugins (settings, deviceId) {
|
|||
}
|
||||
}
|
||||
|
||||
console.log(code)
|
||||
return Promise.resolve(code)
|
||||
// return sms.sendMessage(settings, rec)
|
||||
// .then(() => code)
|
||||
return email.sendCustomerMessage(settings, rec)
|
||||
.then(() => code)
|
||||
}
|
||||
|
||||
function sweepHdRow (row) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue