@kne/fastify-account 2.0.5 → 2.0.6

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.
@@ -235,18 +235,20 @@ const accountController = fp(async (fastify, options) => {
235
235
  tags: ['账号'], summary: '忘记密码', body: {
236
236
  oneOf: [{
237
237
  type: 'object', required: ['email'], properties: {
238
- email: { type: 'string', description: '邮箱' }
238
+ email: { type: 'string', description: '邮箱' }, referer: { type: 'string', description: '来源' }
239
239
  }
240
240
  }, {
241
241
  type: 'object', required: ['phone'], properties: {
242
- phone: { type: 'string', description: '手机号' }
242
+ phone: { type: 'string', description: '手机号' }, referer: { type: 'string', description: '来源' }
243
243
  }
244
244
  }]
245
245
  }
246
246
  }
247
247
  }, async request => {
248
248
  const name = request.body.email || request.body.phone;
249
- const token = await services.account.sendJWTVerificationCode({ name, type: 5 });
249
+ const token = await services.account.sendJWTVerificationCode({
250
+ name, type: 5, options: { referer: request.body.referer }
251
+ });
250
252
  return options.isTest ? { token } : {};
251
253
  });
252
254
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kne/fastify-account",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "用于用户注册登录认证.",
5
5
  "main": "index.js",
6
6
  "scripts": {