Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

How to prevent users with expired JWTs from receiving Firebase Cloud Messaging notifications after automatic logout?

Open
#943 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
firebase, javascript, node.js

Research direction

No repository files or tests are named. Review the JWT expiration and jwt.verify flow described in the issue alongside the FCM notification flow; a complete outcome would need a defined way to prevent notifications after token expiry, but the issue does not specify a code change or integration point.

Written by the indexing model from the issue text.

Description

I have an issue where users whose JWT tokens have expired are still receiving FCM notifications after being automatically logged out.

The problem is the JWT expires and the user is logged out when they open the app and request the backend API which does jwt.verify. But FCM notifications can be sent without opening the app.

For example, if the JWT expires after 1 minute when the user logs in, and the user doesn't open the app again for 1 hour/1 day, their FCM token is still active because there was no logout action since they logged in.

So when a notification is sent, and the user opens it, they get redirected to the app and are automatically logged out. But they shouldn't have received the notification in the first place.

How can I prevent users with expired JWTs from receiving FCM notifications after automatic logout? Any suggestions would be appreciated!

Dominant language
JavaScript
Stars
18.2k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from auth0/node-jsonwebtoken

All issues in auth0/node-jsonwebtoken

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.