
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
storybook-addon-next-auth
Advanced tools
Use NextAuth.js in your Storybook stories.
Install this library by adding it to your devDependencies:
yarn:
yarn install --dev storybook-addon-next-auth
npm:
npm install --save-dev storybook-addon-next-auth
pnpm:
pnpm add --save-dev storybook-addon-next-auth
Update .storybook/main.js
and append to your list of addons:
// .storybook/main.js
module.exports = {
addons: ['storybook-addon-next-auth']
}
After restarting your storybook, an additional icon will appear in the toolbar. It allows you to select the current session state:
You may now control and test your component state of useSession()
by the toolbar items:
If you need to change your stories code while using session values, you may access those by the useSession
hook.
import { useSession } from 'next-auth/react';
export const MyStory = (props) => {
// get access to current session data
const session = useSession();
...
This component brings a default set of auth states: unknown
, loading
, unauthenticated
and authenticated
.
⏱ Coming Soon
⏱ Coming Soon
Author: Emilio Schaedler Heinzmann
Special thanks for Tom Freudenberg, the creator of next-auth-mock, where I've based my work for this library.
FAQs
Use NextAuth.js in your Storybook stories
We found that storybook-addon-next-auth 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.