
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@contentchef/auth0-react
Advanced tools
npm i --save @contentchef/auth0-react
# or
yarn add @contentchef/auth0-react
// in your main application file
import { Auth0Provider } from '@contentchef/auth0-react';
import React from 'react';
import ReactDOM from 'react-dom';
import MyApp from './MyApp';
ReactDOM.render(
<Auth0Provider
audience="your-api-audience"
clientID="your-auth0-client-id"
domain="your-application-domain"
redirectUri="/path/to/callback-component"
responseMode="token"
responseType="token id_token"
scope="openid profile email"
>
<MyApp />
</Auth0Provider>
, document.getElementById('app'));
import React from 'react';
import { Auth0Callback } from '@contentchef/auth0-react';
const requestEndHandler = (error, decodedAuthToken) => {
if (error) {
return history.pushState(error, undefined, '/error-route')
}
return history.pushState(null, undefined, '/');
};
export default () => (
<Auth0Callback onAuthenticationEnd={requestEndHandler}>
<h1>You are logging in...</h1>
<p>You will be redirected in seconds</p>
</Auth0Callback>
)
import React from 'react';
import { Authorized, Unauthorized } from '@contentchef/auth0-react';
export default () => (
<div>
<Authorized>
You are authenticated
</Authorized>
<Unauthorized>
You are not authenticated
</Unauthorized>
</div>
)
import React from 'react';
import { Authorized, Unauthorized, withUser, IWithUserProps } from '@contentchef/auth0-react';
export default withUser()(({ user }: IWithUserProps) => (
<div>
<Authorized>
Hello { user.name }, <LogoutButton>logout</LogoutButton>
</Authorized>
<Unauthorized>
Hello, <LoginButton>logout</LoginButton>
</Unauthorized>
</div>
))
// in your components/hocs/containers/...
import React from 'react';
import { withAuthentication, LoginButton } from '@contentchef/auth0-react';
export const OnlyAuthUsers = withAuthentication(true)(() => (
<div>
<div>
Hello! You will see this only if authenticated.
</div>
</div>
))
export const OnlyUnAuthUsers = withAuthentication(false)(() => (
<div>
<div>
Hello! You are not logged in, please
<LoginButton>Login</LoginButton> before proceeding
</div>
</div>
))
// in your components/hocs/containers/...
import React from 'react';
import { Authorized, Unauthorized, withUser, IWithUserProps } from '@contentchef/auth0-react';
export default withUser()(({ user }: IWithUserProps) => (
<div>
<Authorized>
Hello { user.name }, <LogoutButton>logout</LogoutButton>
</Authorized>
<Unauthorized>
Hello, <LoginButton>logout</LoginButton>
</Unauthorized>
</div>
));
FAQs
A component library for user handling
The npm package @contentchef/auth0-react receives a total of 21 weekly downloads. As such, @contentchef/auth0-react popularity was classified as not popular.
We found that @contentchef/auth0-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.