File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -536,6 +536,9 @@ export class FirebaseAuthRequestHandler {
536
536
* In addition to revoking all refresh tokens for a user, all ID tokens issued
537
537
* before revocation will also be revoked on the Auth backend. Any request with an
538
538
* ID token generated before revocation will be rejected with a token expired error.
539
+ * Note that due to the fact that the timestamp is stored in seconds, any tokens minted in
540
+ * the same second as the revocation will still be valid. If there is a chance that a token
541
+ * was minted in the last second, delay for 1 second before revoking.
539
542
*
540
543
* @param {string } uid The user whose tokens are to be revoked.
541
544
* @return {Promise<string> } A promise that resolves when the operation completes
Original file line number Diff line number Diff line change @@ -167,7 +167,9 @@ describe('admin.auth', () => {
167
167
} )
168
168
. then ( ( decodedIdToken ) => {
169
169
// Verification should succeed. Revoke that user's session.
170
- return admin . auth ( ) . revokeRefreshTokens ( decodedIdToken . sub ) ;
170
+ return new Promise ( ( resolve ) => setTimeout ( ( ) => resolve (
171
+ admin . auth ( ) . revokeRefreshTokens ( decodedIdToken . sub )
172
+ ) , 1000 ) ) ;
171
173
} )
172
174
. then ( ( ) => {
173
175
// verifyIdToken without checking revocation should still succeed.
You can’t perform that action at this time.
0 commit comments