Skip to content

Correctly handle token refreshes with Google #11

@mattrayner

Description

@mattrayner

Is your feature request related to a problem? Please describe.
Currently every time the Google token expires, we are creating a new one, sending the user creds to Google and receiving a token in response. We should behave like good API citizens and instead, refresh the token.

Describe the solution you'd like
We should identify wether or not a token has expired (or is neat expiry) and change the request that we send to be a 'refresh' rather than a new authorisation.

We will need to handle the various errors that can be sent by Google as part of the refresh, and use these to inform the user of issues. Additionally, we should have automatic re-auth. In instances where we are able to, we should attempt a 'full' re-authentication when the refresh fails.

Describe alternatives you've considered
We could leave the system as it is... It works, but we should always strive to be better, and leaving it is certainly not best practices.

Additional context
After Pod Point changed their auth system to Google, the ability to refresh opened up.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions