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 auth_time in Auth Emulator. #3674
Conversation
812eff0
to
8b310ea
Compare
0510d46
to
f5f44a2
Compare
@@ -1755,6 +1750,27 @@ function generateJwt( | |||
return jwtStr; | |||
} | |||
|
|||
function getAuthTime(user: UserInfo): Date { | |||
if (user.lastLoginAt != null) { |
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.
!==
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.
This is intentional since it can be undefined
. TS won't let me do !== null
throw new Error(`Internal assertion error: invalid user.lastLoginAt = ${user.lastLoginAt}`); | ||
} | ||
return authTime; | ||
} else if (user.lastRefreshAt != null) { |
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.
and here
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.
ditto
* Fix auth_time in Auth Emulator. * Update CHANGELOG.md
Description
Fixes #3671.
Fixes #3663.
Fixes #3673.
Date parsing is hard. This was broken in #3611. I've added comments and assertions for the details.
Scenarios Tested
Tests added in #3611 was also wrong and I've fixed that as well. Again, date parsing is hard.
Sample Commands
N/A