Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/auth/auth-api-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ export abstract class AbstractAuthRequestHandler {
const request: any = {
localId: uid,
// validSince is in UTC seconds.
validSince: Math.ceil(new Date().getTime() / 1000),
validSince: Math.floor(new Date().getTime() / 1000),
};
return this.invokeRequestHandler(this.getAuthUrlBuilder(), FIREBASE_AUTH_SET_ACCOUNT_INFO, request)
.then((response: any) => {
Expand Down
6 changes: 3 additions & 3 deletions test/unit/auth/auth-api-request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1955,8 +1955,8 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => {
it('should be fulfilled given a valid uid', () => {
const requestData = {
localId: uid,
// Current time should be passed, rounded up.
validSince: Math.ceil((now.getTime() + 5000) / 1000),
// Current time should be passed, rounded down.
validSince: Math.floor((now.getTime() + 5000) / 1000),
};
const stub = sinon.stub(HttpClient.prototype, 'send').resolves(expectedResult);
stubs.push(stub);
Expand Down Expand Up @@ -1995,7 +1995,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => {
});
const requestData = {
localId: uid,
validSince: Math.ceil((now.getTime() + 5000) / 1000),
validSince: Math.floor((now.getTime() + 5000) / 1000),
};
const stub = sinon.stub(HttpClient.prototype, 'send').rejects(expectedServerError);
stubs.push(stub);
Expand Down