Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@storyblok/app-extension-auth
Advanced tools
A typed JavaScript library that manages authentication for 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.