We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I noted that the Swift version of this library doesn't contain the leeway value as it's present on the auth0/JWTDecode.Android:
leeway
https://github.com/auth0/JWTDecode.Android/blob/ec4b54496e684c5fb9e65f5ebb36e6241ef46161/lib/src/main/java/com/auth0/android/jwt/JWT.java#L161-L171
The issue in this source code can be found here:
JWTDecode.swift/JWTDecode/JWTDecode.swift
Line 54 in 75d29dc
Is that right? Shouldn't the libraries behave the same between the platforms?
Regards
Transform the value expired into a function that allow a leeway time, example:
expired
struct JWT { var expiresAt: Date? //... var expired: Bool { self.expired() } func expired(leeway: Int = 0) -> Bool { guard let date = self.expiresAt else { return false } return date.compare(applyLeeway(Date(), leeway)) != ComparisonResult.orderedDescending } private func applyLeeway(_ date: Date, _ leeway: Int) -> Date { return date //// + leeway } }
While it's possible to modify the expiredAt, I don't believe it should be done as it's modifying the JWT content.
expiredAt
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Checklist
Describe the problem you'd like to have solved
Hi,
I noted that the Swift version of this library doesn't contain the
leeway
value as it's present on the auth0/JWTDecode.Android:https://github.com/auth0/JWTDecode.Android/blob/ec4b54496e684c5fb9e65f5ebb36e6241ef46161/lib/src/main/java/com/auth0/android/jwt/JWT.java#L161-L171
The issue in this source code can be found here:
JWTDecode.swift/JWTDecode/JWTDecode.swift
Line 54 in 75d29dc
Is that right? Shouldn't the libraries behave the same between the platforms?
Regards
Describe the ideal solution
Transform the value
expired
into a function that allow aleeway
time, example:Alternatives and current workarounds
While it's possible to modify the
expiredAt
, I don't believe it should be done as it's modifying the JWT content.Additional context
No response
The text was updated successfully, but these errors were encountered: