Skip to content
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

[FEATURE REQUEST] Change time based token refresh to triggered #206

Open
mars3142 opened this issue Jun 8, 2021 · 3 comments
Open

[FEATURE REQUEST] Change time based token refresh to triggered #206

mars3142 opened this issue Jun 8, 2021 · 3 comments
Labels
enhancement New feature or request Hacktoberfest

Comments

@mars3142
Copy link

mars3142 commented Jun 8, 2021

Is your feature request related to a problem? Please describe.
Didn't tested it, but it could be possible, that the 1h timer for a token refresh will fail. So the next call to the Firebase would also failing unauthenticated. That's why I would get rid of the timer based refreshing.

Describe the solution you'd like
The token is a plain JWT, so it contains a exp attribute, which can be checked against. If the time is in a defined time window (1 min, 5 min, 10 min) or later you can use it to refresh the token with the refresh token. But here is the fun part. If the game didn't call the Firebase for hours, you don't need to refresh that token, because the refresh token will work forever.

My idea for a better solution would be to parse the JWT and only call refresh, if a call is made to the firebase eg. 2 min before the exp or later. So you can save bandwith and batterie (on mobile), because the radio didn't need to be activated for your game.

I know this will be a large change in the codebase, but it should be done. Only do external requests if needed and every hour isn't needed, if the game/app isn't calling Firebase.

@mars3142 mars3142 added the enhancement New feature or request label Jun 8, 2021
@BearDooks
Copy link
Member

@mars3142 this would be a pretty big lift, let me check with the team and see what they think.

Thanks

Chuck

@WolfgangSenff
Copy link
Collaborator

This is going to be a bit too much for the time being. It's not a bad idea, and we have some thoughts on how to at least mitigate the problems you point out, but I'm prepping for GodotCon, and everyone else is busy/has lives. :) I'll leave this open for now, just making sure to reply.

@mars3142
Copy link
Author

Cool, thanks for the reply. I know that this would be a big change, as I wrote it already within my FR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hacktoberfest
Projects
None yet
Development

No branches or pull requests

3 participants