
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@withyouwithme/promisify-auth0
Advanced tools
Promisifying wrapper around the Client Side Javascript toolkit for Auth0 API
From npm
npm i --save promisify-auth0
The package is mirroring the original auth0.js API. The only difference is that instead of NodeJS callback function style, promisify-auth0
allows you to get Promise<T>
instead which help avoid callback hell and play nicely with async/await
.
You will still need to create an original Auth0 objects and inject them into the corresponding wrapping types, something like this:
import { Authentication as NativeAuthentication } from 'auth0-js';
import { Authentication } from 'promisify-auth0';
const nativeAuthentication: NativeAuthentication = ...;
const authentication = new Authentication(nativeAuthentication);
const options = { realm: '...', audience: '...', username: '...', password: '...', scope: '...' };
authentication.login(options)
.then(loginResult => {
// ...
})
.catch(caughtError => {
// ...
});
The last piece of code could be rewritten in a more imperative style while maintaining the asyncronous execution model.
try {
const loginResult = await authentication.login(options);
// ...
} catch (caughtError) {
// ...
}
This code is distributed under MIT license.
Please respect the Code of Conduct.
Feel free to contribute.
FAQs
Make Auth0-js work with promises instead of callbacks.
The npm package @withyouwithme/promisify-auth0 receives a total of 8 weekly downloads. As such, @withyouwithme/promisify-auth0 popularity was classified as not popular.
We found that @withyouwithme/promisify-auth0 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.