Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
storybook-addon-next-auth0
Advanced tools
Allows you to use useUser
from @auth0/nextjs-auth0
It decores your stories with a mocked UserProvider
that you can control on a storybook panel.
npm i -d storybook-addon-next-auth0
add "storybook-addon-next-auth0" to you .storybook/main.js
addons
That's all.
module.exports = {
const path = require("path");
module.exports = {
"stories": [
"../components/**/*.stories.@(js|jsx)",
"../pageStories/**/*.stories.@(js|jsx)",
],
"addons": [
'storybook-addon-next-auth0',
"@storybook/addon-links",
"@storybook/addon-essentials",
],
}
You can pass the initial useUser value to any story though story's parameters
import React from "react";
import { UserPrint } from "./Example";
export default {
title: "Example/User",
component: UserPrint,
parameters: {
initialUser: {
isLoading: true,
}
}
};
export const Loading = () => <UserPrint />
export const Logged = () => <UserPrint />
Logged.parameters = {
initialUser: {
isLoading: false,
user: {
email: 'john@doe.com',
email_verified: true,
nickname: 'Joe',
picture: 'https://picsum.photos/200',
sub: 'mock:johndoe',
updated_at: '2021-04-02T12:42:42.042Z',
}
}
}
export const ErrorStory = () => <UserPrint />
ErrorStory.parameters = {
initialUser: {
isLoading: false,
error: 'Something went wrong'
}
}
FAQs
Managed userProvider decorator for nextjs-auth0
We found that storybook-addon-next-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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.