Skip to content

Commit

Permalink
feat(server): add connection info to RefreshTokensSuccess hook (#987)
Browse files Browse the repository at this point in the history
  • Loading branch information
pradel committed May 25, 2020
1 parent 728db00 commit 956b2c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/server/__tests__/account-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@ describe('AccountsServer', () => {
undefined,
]);
expect(res).toEqual({
infos: {
ip: 'ip',
userAgent: 'userAgent',
},
sessionId: '456',
tokens: {
accessToken: 'newAccessToken',
Expand Down Expand Up @@ -693,6 +697,10 @@ describe('AccountsServer', () => {
'123',
]);
expect(res).toEqual({
infos: {
ip: 'ip',
userAgent: 'userAgent',
},
sessionId: '456',
tokens: {
accessToken: 'newAccessToken',
Expand Down
1 change: 1 addition & 0 deletions packages/server/src/accounts-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ Please set ambiguousErrorMessages to false to be able to use autologin.`
sessionId: session.id,
tokens,
user,
infos,
};

this.hooks.emit(ServerHooks.RefreshTokensSuccess, result);
Expand Down

0 comments on commit 956b2c6

Please sign in to comment.