feat: customer auth via email

This commit is contained in:
Rafael Taranto 2023-11-28 17:36:29 +00:00
parent 92a3f16c80
commit ab304093f3
22 changed files with 252 additions and 27 deletions

View file

@ -779,6 +779,27 @@ function plugins (settings, deviceId) {
})
}
function getEmailCode (toEmail) {
const notifications = configManager.getNotifications(settings.config)
const code = notifications.thirdParty_email === 'mock-email'
? '123'
: randomCode()
const req = {
email: {
toEmail,
subject: 'Your cryptomat code',
text: `Your cryptomat code: ${code}`
}
}
console.log(code)
return Promise.resolve(code)
// return sms.sendMessage(settings, rec)
// .then(() => code)
}
function sweepHdRow (row) {
const txId = row.id
const cryptoCode = row.crypto_code
@ -862,6 +883,7 @@ function plugins (settings, deviceId) {
isZeroConf,
getStatus,
getPhoneCode,
getEmailCode,
executeTrades,
pong,
clearOldLogs,