-
Notifications
You must be signed in to change notification settings - Fork 389
fix(auth): Add lastRefreshTime to UserMetadata toJSON method. #889
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
Changes from all commits
4d5c216
eacce1a
2a92140
8bb80c1
f072d6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,7 @@ function getValidUserResponse(tenantId?: string): GetAccountInfoUserResponse { | |
validSince: '1476136676', | ||
lastLoginAt: '1476235905000', | ||
createdAt: '1476136676000', | ||
lastRefreshAt: '2016-10-12T01:31:45.000Z', | ||
customAttributes: JSON.stringify({ | ||
admin: true, | ||
}), | ||
|
@@ -159,6 +160,7 @@ function getUserJSON(tenantId?: string): object { | |
metadata: { | ||
lastSignInTime: new Date(1476235905000).toUTCString(), | ||
creationTime: new Date(1476136676000).toUTCString(), | ||
lastRefreshTime: new Date(1476235905000).toUTCString(), | ||
}, | ||
customClaims: { | ||
admin: true, | ||
|
@@ -629,6 +631,7 @@ describe('UserMetadata', () => { | |
const expectedMetadataJSON = { | ||
lastSignInTime: new Date(expectedLastLoginAt).toUTCString(), | ||
creationTime: new Date(expectedCreatedAt).toUTCString(), | ||
lastRefreshTime: new Date(expectedLastRefreshAt).toUTCString(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are lacking test cases for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the code now (2y later) I see some test cases for this, but perhaps not as many as there should be. I think that's independent of this PR though. |
||
}; | ||
|
||
describe('constructor', () => { | ||
|
@@ -890,6 +893,7 @@ describe('UserRecord', () => { | |
const metadata = new UserMetadata({ | ||
createdAt: '1476136676000', | ||
lastLoginAt: '1476235905000', | ||
lastRefreshAt: '2016-10-12T01:31:45.000Z', | ||
} as any); | ||
expect(userRecord.metadata).to.deep.equal(metadata); | ||
}); | ||
|
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.
Unrelated to this PR. But are the fields like
createdAt
actually sent as strings (quoted), not numbers?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.
Yeah they are all sent as strings. Here is a snippet: