question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Couple feature requests

See original GitHub issue

First off thank you so much for this library. You just single handedly shaved nearly 1MB off my build now that I can toss jsonwebtoken.

  1. Option for outputting the payload during verify
try {
  await JWT.verify(authToken, JWT_TOKEN)
  jwt = await JWT.decode(authToken)
} catch(err) {
  throw {status: 401, message: `Invalid or expired authorization token`}
}

INTO

try {
  jwt = await JWT.verify(authToken, JWT_TOKEN)
} catch(err) {
  throw {status: 401, message: `Invalid or expired authorization token`}
}
  1. Validate exp keys during verify

  2. Support for Buffer secrets

JWT.verify(authToken, Buffer.from(JWT_TOKEN, 'base64'))
  1. Support for es6 import destructuring syntax
import { verify } from '@tsndr/cloudflare-worker-jwt'
  1. If you’re feeling really ambitions support verifying complex JWSs like what is being sent back from the Android safetynet attestation. https://developer.android.com/training/safetynet/attestation 😬

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tsndrcommented, May 22, 2021
  1. No worries man. This project is only loosely inspired by the jsonwebtoken library and I’m not the biggest fan of using exceptions unless something really breaks to be honest, although this is a personal preference. To me an if is cleaner than a try-catch.

  2. Oh you meant expiry, see I’m stupid too 😅. Obviously, this is something I should absolutely add and a huge oversight on my part. This goes right to the top of my TODO list and I’ll try to add it.

  3. Maybe I should add it. Options are good, right? 🤔

  4. While I’m already in there, I might add it as well.

Thank you for the workaround, even though it shouldn’t be necessary anymore once I finished my work on 2..

0reactions
tsndrcommented, May 25, 2021

Since we’ve sorted everything out in discord I’m gonna go ahead and close this issue 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing feature requests: A comprehensive guide - UserVoice
Feature requests are precious opportunities to better serve your users' ... Here are a couple of key communication points to follow up with...
Read more >
A couple of feature requests. - Google Groups
1. Arbitrary HTTP requests. 2. Content-type handlers. 3. Protocol handlers. ... anticipate their addition). ... be able to make HTTP requests.* JSONP isn't...
Read more >
Feature Requests: How to Collect Them and Engage Users in ...
Feature requests are an important window into your customers desires and priorities. Here's how to make the most of them, and handle the ......
Read more >
A couple of feature requests for a great theme! - WordPress.org
A couple of feature requests for a great theme! ... Current: The background overlay image span full screen from left to right. However...
Read more >
A couple feature requests - Veeam R&D Forums
Veeam Community discussions and solutions for: A couple feature requests of PowerShell. ... Some selfish requests for PowerShell.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found