Skip to content

Commit

Permalink
Add token to forgot-password emitter (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcodefaster authored Jul 10, 2024
1 parent 87ffb38 commit c40c1f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/user.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ describe('User Model', async function () {

it('should generate a password reset token', function () {
const emitterPromise = new Promise<any>(function (resolve) {
emitter.once('forgot-password', function (user) {
emitter.once('forgot-password', function ({ user, token }) {
expect(user.key).to.equal('superuser');
resolve(user);
});
Expand Down

0 comments on commit c40c1f5

Please sign in to comment.