feat(salix): refs #6427 use isProduction validation
This commit is contained in:
parent
4d40d825a2
commit
56444b3d33
|
@ -1,3 +1,4 @@
|
|||
const isProduction = require('vn-loopback/server/boot/isProduction');
|
||||
const UserError = require('vn-loopback/util/user-error');
|
||||
const authCode = require('../../models/authCode');
|
||||
module.exports = Self => {
|
||||
|
@ -50,9 +51,9 @@ module.exports = Self => {
|
|||
|
||||
const code = await authCode(user, myOptions);
|
||||
|
||||
if (process.env.NODE_ENV === 'production')
|
||||
await Self.app.models.Sms.send({req: {accessToken: {userId: id}}}, +userId, code);
|
||||
return {code};
|
||||
if (!isProduction())
|
||||
return {code};
|
||||
await Self.app.models.Sms.send({req: {accessToken: {userId: id}}}, +userId, code);
|
||||
} catch (err) {
|
||||
if (err.code === 'EMAIL_NOT_FOUND')
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue