Skip to content

Commit c40c1f5

Browse files
Add token to forgot-password emitter (#93)
1 parent 87ffb38 commit c40c1f5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ export class User {
10311031
{ user: user, req: req, token: token }
10321032
);
10331033
}
1034-
this.emitter.emit('forgot-password', user, token);
1034+
this.emitter.emit('forgot-password', { user , token });
10351035
}
10361036

10371037
/**

test/user.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ describe('User Model', async function () {
618618

619619
it('should generate a password reset token', function () {
620620
const emitterPromise = new Promise<any>(function (resolve) {
621-
emitter.once('forgot-password', function (user) {
621+
emitter.once('forgot-password', function ({ user, token }) {
622622
expect(user.key).to.equal('superuser');
623623
resolve(user);
624624
});

0 commit comments

Comments
 (0)