JWTDecode.swift icon indicating copy to clipboard operation
JWTDecode.swift copied to clipboard

feat: make `JWTDecode.JWT` conform to sendable

Open xinnjie opened this issue 11 months ago • 1 comments

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

xinnjie avatar May 23 '25 15:05 xinnjie

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.

Widcket avatar May 30 '25 23:05 Widcket