-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: emulator auth_time (#3608) #3611
fix: emulator auth_time (#3608) #3611
Conversation
Made emulator auth_time match how auth_time is populated in production. (auth_time should match user's lastLoginAt in seconds)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Looks pretty good to me. A few comments inline for you though. @lisajian will also help with the review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, LGTM pending @yuchenshi's feedback. Thank you for the fix!
@yuchenshi @lisajian Resolved all 3 comments. I think that's everything! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'll update the comments and merge after CI passes
Apparently linter is not happy about the code formatting, but we'll fix this on our side -- just don't delete your fork branch yet! |
This is now merged and will be included in the next release. Thanks again for the help! |
* fix: emulator auth_time (firebase#3608) Made emulator auth_time match how auth_time is populated in production. (auth_time should match user's lastLoginAt in seconds) * Check not null just in case lastLoginAt is 0 because of unit test clock mocking * Advance clock to verify auth_time is not refresh time * assert user.lastLoginAt is not undefined * Apply suggestions from code review * Format code. Co-authored-by: Yuchen Shi <yuchenshi@google.com>
Description
Fixes #3608 so that emulator sets auth_time the same way production does (auth_time should match lastLoginAt in seconds)
Scenarios Tested
Added unit test to src/test/emulators/auth/misc.spec.ts called
"should populate auth_time to match lastLoginAt (in seconds since epoch)"
This unit test...