JWTDecode.swift
JWTDecode.swift copied to clipboard
feat: make `JWTDecode.JWT` conform to sendable
Checklist
- [x] I have looked into the Readme and have not found a suitable solution or answer.
- [x] I have searched the issues and have not found a suitable solution or answer.
- [x] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- [x] I agree to the terms within the Auth0 Code of Conduct.
Describe the problem you'd like to have solved
Hi,
I wonder if JWTDecode.JWT can conform to sendable?
When using Swift new concurrency feature, i.e. async/await, it would be convinient in many use cases if JWTDecode.JWT can conform to sendable
https://community.auth0.com/t/credentialsmanager-credentials-and-sendability/95271 may be related.
Describe the ideal solution
DecodedJWT is struct type, shoud be easy to conform to sendable
Alternatives and current workarounds
No response
Additional context
No response
Hi @xinnjie,
The JWT protocol is public, so making it conform to Sendable may break other types conforming to it in client apps, like, for example, test mocks. So it cannot be made Sendable in the current major version.