File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change
1
+ # v5.0.3
2
+ - Fix an issue where JWT date timestamps weren't parsed correctly.
3
+
1
4
# v5.0.2
2
5
- Fix an issue where anonymous accounts weren't correctly promoted to
3
6
non-anonymous when linked with passwordless email auth accounts.
Original file line number Diff line number Diff line change @@ -890,12 +890,14 @@ - (FIRAuthTokenResult *)parseIDToken:(NSString *)token error:(NSError **)error {
890
890
return nil ;
891
891
}
892
892
893
+ // These are dates since 00:00:00 January 1 1970, as described by the Terminology section in
894
+ // the JWT spec. https://tools.ietf.org/html/rfc7519
893
895
NSDate *expDate =
894
- [NSDate dateWithTimeIntervalSinceNow : [tokenPayloadDictionary[@" exp" ] doubleValue ]];
896
+ [NSDate dateWithTimeIntervalSince1970 : [tokenPayloadDictionary[@" exp" ] doubleValue ]];
895
897
NSDate *authDate =
896
- [NSDate dateWithTimeIntervalSinceNow : [tokenPayloadDictionary[@" auth_time" ] doubleValue ]];
898
+ [NSDate dateWithTimeIntervalSince1970 : [tokenPayloadDictionary[@" auth_time" ] doubleValue ]];
897
899
NSDate *issuedDate =
898
- [NSDate dateWithTimeIntervalSinceNow : [tokenPayloadDictionary[@" iat" ] doubleValue ]];
900
+ [NSDate dateWithTimeIntervalSince1970 : [tokenPayloadDictionary[@" iat" ] doubleValue ]];
899
901
FIRAuthTokenResult *result =
900
902
[[FIRAuthTokenResult alloc ] initWithToken: token
901
903
expirationDate: expDate
You can’t perform that action at this time.
0 commit comments