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.
@storyblok/app-extension-auth
Advanced tools
A typed JavaScript library for handling authentication with Storyblok apps.
@storyblok/app-extension-auth
A typed JavaScript library for handling authentication with Storyblok apps.
Under the app settings > Oauth 2, handle configure the following:
URL to your app: https://[your-domain]/
OAuth2 callback URL https://[your-domain]/api/connect/storyblok/callback
(Substitute [your-domain] to your app's domain.)
On Linux/Mac, run:
openssl rand -base64 64
In your source code, create an options object:
import { AuthHandlerParams,} from '@storyblok/app-extension-auth'
export const params: AuthHandlerParams = {
// Provide values for all keys
}
In NodeJS, create a dynamic route that handles the incoming requests with authHandler()
. See Framework examples.
For example, in Next.js, create a file pages/api/connect/[...slugs].ts
:
import { authHandler } from '@storyblok/app-extension-auth'
export default authHandler(params)
Sign in a user by redirecting to the api route: /api/connect/storyblok
This will initiate the oauth flow and redirect the user to the url specified in the successCallback
url. The following query parameters will be appended:
userId
spaceId
Now use these query parameters to retrieve the session object:
import { sessionCookieStore } from '@storyblok/app-extension-auth'
const sessionStore = sessionCookieStore(params)(context)
const appSession = await sessionStore.get(query)
if(appSession === undefined){
// The user is not authenticated
// redirect to /api/connect/storyblok
}
In Next.js, create a file pages/api/connect/[...slugs].ts
import { authHandler } from '@storyblok/app-extension-auth'
export default authHandler(params)
In ExpressJs, create a route
import { authHandler } from '@storyblok/app-extension-auth'
app.all(
'/api/connect/*',
authHandler(params)
)
TODO: This has not been tested
FAQs
A typed JavaScript library for handling authentication with Storyblok apps.
We found that @storyblok/app-extension-auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.