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

fix(auth, android): do not timezone offset when getting UTC timestamp #4886

Merged
merged 3 commits into from
Feb 9, 2021

Conversation

kouheiszk
Copy link
Contributor

Description

In Android, JWT's iat and exp are now converted to correctly UTC time in strings.
Unnecessary offsets were being added to the timestamps, causing them to be converted to the wrong UTC time in strings.

Related issues

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

I have tested the following:

  • The JWT iat was correctly converted to UTC time.
  • The JWT exp was correctly converted to UTC time.

Think react-native-firebase is great? Please consider supporting the project with any of the below:

@CLAassistant
Copy link

CLAassistant commented Feb 9, 2021

CLA assistant check
All committers have signed the CLA.

@vercel
Copy link

vercel bot commented Feb 9, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/invertase/react-native-firebase/8k849l3a4
✅ Preview: https://react-native-firebase-git-fork-kouheiszk-master.invertase.vercel.app

@codecov
Copy link

codecov bot commented Feb 9, 2021

Codecov Report

Merging #4886 (ca14897) into master (c832407) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4886   +/-   ##
=======================================
  Coverage   89.06%   89.06%           
=======================================
  Files         109      109           
  Lines        3720     3720           
  Branches      347      347           
=======================================
  Hits         3313     3313           
  Misses        365      365           
  Partials       42       42           

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there! Thanks for this, I think you are on to something but we need to be careful with shared APIs

I left a comment related to the other consumers of the shared API you modified - can you have a look at it and tell me what you think?

@mikehardy mikehardy added Workflow: Waiting for User Response Blocked waiting for user response. platform: android plugin: authentication Firebase Authentication labels Feb 9, 2021
@kouheiszk kouheiszk requested a review from mikehardy February 9, 2021 15:45
@mikehardy mikehardy changed the title fix(auth, andriod): converting timestamps to the correct UTC time in strings fix(auth, android): do not timezone offset when getting UTC timestamp Feb 9, 2021
@mikehardy mikehardy merged commit 85d6801 into invertase:master Feb 9, 2021
@mikehardy mikehardy removed the Workflow: Waiting for User Response Blocked waiting for user response. label Feb 9, 2021
androidIsForVivek pushed a commit to androidIsForVivek/react-native-firebase that referenced this pull request Aug 9, 2021
…invertase#4886)

* Add test for expirationTime of tokenResult
* Fix android timestampToUTC util
* Use single quote
androidIsForVivek pushed a commit to androidIsForVivek/react-native-firebase that referenced this pull request Sep 15, 2021
…invertase#4886)

* Add test for expirationTime of tokenResult
* Fix android timestampToUTC util
* Use single quote
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants