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

Custom params unsupported by JWT utils types #498

Open
JasirZaeem opened this issue Oct 10, 2024 · 0 comments
Open

Custom params unsupported by JWT utils types #498

JasirZaeem opened this issue Oct 10, 2024 · 0 comments

Comments

@JasirZaeem
Copy link

The docs suggest nesting any extra params under a custom key, in signed tokens. https://docs.mux.com/guides/secure-video-playback#passing-custom-parameters-to-a-signed-token

{
  "sub": "{PLAYBACK_ID}",
  "aud": "{AUDIENCE_TYPE}",
  "exp": "{EXPIRATION_TIME}",
  "custom": {
    "session_id": "xxxx-123"
  }
}

But the type of params field in the MUXJWTSignOptions does not allow this, necessitating the use of ts-ignore if custom parameters are being used.

params?: Record<string, string>;

Maybe this can be expanded to something more relaxed like params?: Record<string, string | Record<string, string>>; ?

Not the most severe bug but would be a nice QOL improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant