
Security News
Safari 18.4 Ships 3 New JavaScript Features from the TC39 Pipeline
Safari 18.4 adds support for Iterator Helpers and two other TC39 JavaScript features, bringing full cross-browser coverage to key parts of the ECMAScript spec.
@8base/web-auth0-auth-client
Advanced tools
The 8base auth0 auth client for the AuthProvider
.
Create an instance of the web auth0 auth client.
workspaceId
string Identifier of the 8base app workspace.domain
string Domain. See auth0 documentation.clientId
string Client id. See auth0 documentation.redirectUri
string Redurect uri. See auth0 documentation.import { AuthContext, AuthProvider, type AuthContextProps } from '@8base/react-auth';
import { WebAuth0AuthClient } from '@8base/web-auth0-auth-client';
const authClient = new WebAuth0AuthClient({
domain: 'domain',
clientId: 'client-id',
redirectUri: `${window.location.origin}/auth/callback`,
logoutRedirectUri: `${window.location.origin}/auth`,
});
const renderAuth = (auth) => {
const authorize = async () => {
const authData = await auth.authorize();
await auth.setAuthState({
token: authData.idToken,
email: authData.email,
});
};
const logout = async () => {
await auth.purgeState();
await auth.logout();
};
if (auth.isAuthorized) {
return (
<div>
<p>Hi ${auth.authState.email} !</p>
<button type='button' onClick={ logout }>Logout</button>
</div>
);
}
return (
<div>
<button type='button' onClick={ authorize }>Authorize with auth0<button/>
</div>
);
};
...
<AuthProvider authClient={ authClient }>
...
<AuthContext.Consumer>
{ renderAuth }
</AuthContext.Consumer>
...
</AuthProvider>
...
import { WebAuth0AuthClient } from '@8base/web-auth0-auth-client';
const authClient = new WebAuth0AuthClient({
domain: 'domain',
clientId: 'client-id',
redirectUri: `${window.location.origin}/auth/callback`,
logoutRedirectUri: `${window.location.origin}/auth`,
workspaceId: 'workspace-id',
profile: {
id: 'profile-id',
},
});
...
...
import { WebAuth0AuthClient } from '@8base/web-auth0-auth-client';
const authClient = new WebAuth0AuthClient({
domain: 'domain',
clientId: 'client-id',
redirectUri: `${window.location.origin}/auth/callback`,
logoutRedirectUri: `${window.location.origin}/auth`,
workspaceId: 'workspace-id',
profile: {
id: 'profile-id',
isDefault: true,
},
});
...
FAQs
The 8base auth0 auth client for the `AuthProvider`.
We found that @8base/web-auth0-auth-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
Safari 18.4 adds support for Iterator Helpers and two other TC39 JavaScript features, bringing full cross-browser coverage to key parts of the ECMAScript spec.
Research
Security News
The Socket Research Team investigates a malicious Python package that enables automated credit card fraud on WooCommerce stores by abusing real checkout and payment flows.
Security News
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.