Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

101
Views
Firebase revokeRefreshTokens's weird behaviour

so I've been following this documentation about Managing session cookies in firebase, I followed their example almost exactly (I did some tweaks here in there). anyway everything was going as expected except signing out the user, I sign the user out by cleaning the cookies and using the revokeRefreshTokens() method (like they did in the documentation):

router.get("/logout", async (req, res) => {
     const sessionCookie = req.cookies.session || "";
     res.clearCookie("session")
     try {
         const decodedClaims = await admin.auth().verifySessionCookie(sessionCookie);
         await admin.auth().revokeRefreshTokens(decodedClaims.sub);
         res.redirect("/login")
     } catch (e) {
         req.flash("error", "Already logged out")
         res.redirect("back");
     }
});

the problem here is when the user signs out and then immediately tries to log back in, he can't and I get this error on my server: The provided Firebase ID token is expired, the user must wait 30-50 seconds so he can log back in.

So my questions are:

  • Do I need to revokeRefreshTokens() in order to sign the user out?
  • Is the behaviour (not allowing the user to log back in for 30s-50s) of this method is intended?

Note: In the documentation they've used the client sdk to authenticate the user, Instead I used the Auth REST API (in the backend ofcourse).

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!