From c40c1f549c92810042c74ba2b7d0c29ee953be23 Mon Sep 17 00:00:00 2001 From: Max <35369883+maxcodefaster@users.noreply.github.com> Date: Wed, 10 Jul 2024 13:40:36 +0200 Subject: [PATCH] Add token to forgot-password emitter (#93) --- src/user.ts | 2 +- test/user.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/user.ts b/src/user.ts index 24f25d2..38175e9 100644 --- a/src/user.ts +++ b/src/user.ts @@ -1031,7 +1031,7 @@ export class User { { user: user, req: req, token: token } ); } - this.emitter.emit('forgot-password', user, token); + this.emitter.emit('forgot-password', { user , token }); } /** diff --git a/test/user.spec.ts b/test/user.spec.ts index b967369..8ed42c9 100644 --- a/test/user.spec.ts +++ b/test/user.spec.ts @@ -618,7 +618,7 @@ describe('User Model', async function () { it('should generate a password reset token', function () { const emitterPromise = new Promise(function (resolve) { - emitter.once('forgot-password', function (user) { + emitter.once('forgot-password', function ({ user, token }) { expect(user.key).to.equal('superuser'); resolve(user); });