free-be-account 0.0.18 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +9 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -977,7 +977,7 @@ module.exports = (app) => ({
977
977
 
978
978
  const pwdVerified = verifyPassword(password, user.Password, m.config.pwdEncryptMethod || 'md5');
979
979
 
980
- return Promise.resolve(app.modules['sms'].verify(username, cachePwd)).then((cachePwd) => {
980
+ return Promise.resolve(app.modules['account'].sms.verify(username, cachePwd)).then((cachePwd) => {
981
981
  if (!pwdVerified && !cachePwd) {
982
982
  return done(null, false);
983
983
  } else {
@@ -1223,7 +1223,14 @@ module.exports = (app) => ({
1223
1223
  }
1224
1224
  }
1225
1225
 
1226
- const result = await m.sms.sendRandom(phone, m.config.smsFormat || undefined, true, req.body.smsTemp || 'register');
1226
+ let result;
1227
+ try {
1228
+ result = await m.sms.sendRandom(phone, m.config.smsFormat || undefined, true, req.body.smsTemp || 'register');
1229
+ } catch (ex) {
1230
+ app.logger.error(ex.message);
1231
+ res.makeError(504, ex.message || 'Failed to send sms!', m);
1232
+ return next('route');
1233
+ }
1227
1234
 
1228
1235
  if (!result) {
1229
1236
  res.makeError(500, 'Failed to send sms!', m);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-be-account",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "main": "index.js",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {