Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@draftbit/hapi-airtable-authentication-plugin
Advanced tools
Plugin to add JWT-based authentication to a Hapi server using Airtable as a data store
A plugin that adds JWT-based authentication to a Hapi server, utilizing Airtable as a data store. It will trigger a callback function with a verification callback url that can be used to send an email with a "magic link" style confirmation button.
Register the plugin with your Hapi server by doing the following:
await server.register({
plugin: require("@draftbit/hapi-airtable-authentication-plugin"),
options: {
airtableBase: AIRTABLE_BASE,
airtableApiToken: AIRTABLE_API_TOKEN,
jwtSecret: JWT_SECRET,
apiUrl: API_URL,
verifyCallback: ({ email, verificationUrl, loginCode }) => {}
}
});
In Airtable, you must have a table called Users
, with the following columns:
email
, of type Emaillogin_code
, of type Single line textemail_confirmed
, of type CheckboxThe following three routes will be added to your server:
/verify
- Generates a JWT token and triggers the first step in the authentication process, calling verifyCallback
. The following query parameters are required:
/confirm
- The route hit when the user navigates to the verificationUrl
passed in verifyCallback
. The user will be redirected to the linkingUri
passed in the previous step, along with userId
and token
query params. The following query parameters are required, and are already included in the verificationUrl
returned in the previous step:
token
linkingUri
/confirm-code
- This endpoint exists to support the user manually entering the five digit code returned in verifyCallback
, rather than clicking the "magic link" sent in the email. The following query paramters are required:
email
- The user's email addresscode
- The five digit code returned in verifyCallback
All options are required.
airtableBase
- The ID of the Airtable Base you wish to interact withairtableApiToken
- Your Airtable API keyjwtSecret
- A string containing the secret for the HMAC algorithm. See jsonwebtoken docs for more informationapiUrl
- The URL that the Hapi server is public accessible from. This will be used to generate the callback URLverifyCallbacak
- A function that accepts an object with email
, verificationUrl
, and loginCode
keys. This is called after /verify
is calledFAQs
Plugin to add JWT-based authentication to a Hapi server using Airtable as a data store
We found that @draftbit/hapi-airtable-authentication-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.