-
Notifications
You must be signed in to change notification settings - Fork 233
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
Promise Methods #76
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇♂️ |
@joshcanhelp aggressive bot is overly aggressive. please don't dismiss my issue and the 18 upvotes this issue received. |
Agreed, sorry about that. The bot appears to be a little over zealous in its desire to close issues. |
Thank you for the re-open. |
Just found out about this, so maybe someone else can use it too. You can promisify callback methods like this: const { promisify } = require("util");
const jwksClient = require("jwks-rsa");
...
const client = jwksClient({ <yourOptions> });
// promisify the function:
const getSigningKey = promisify(client.getSigningKey);
// use it like any other promise:
const key = await getSigningKey(kid); |
I know this is a node library but I'd also like to be able to use this on frontend sites to verify tokens. The next part can be wrong, only starting with js in browsers so correct me here:
So please don't just promisify the existing callbacks, since this will not change the call to |
I'm experiencing the same behavior in spa as @vinerich described. |
Not to be curt, but it's 2019 folks. Callbacks are relics and
Promise
is the way forward. The last version of Node that doesn't support async/await out of the box is on its last leg and will soon drop out of LTS. Can we please get an updated version that doesn't solely rely on callbacks?The text was updated successfully, but these errors were encountered: