How to use the auth0-js function in auth0-js

To help you get started, we’ve selected a few auth0-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github auth0 / lock-passwordless / src / lock / web_api.js View on Github external
setupClient(lockID, clientID, domain) {
    // TODO: reuse clients
    this.clients[lockID] = new Auth0({
      clientID: clientID,
      domain: domain,
      sendSDKClientInfo: true
    });
  }
github conveyal / mastarm / lib / react / auth0.js View on Github external
export const lock = authIsRequired
  ? new Auth0Lock(
    AUTH0_CLIENT_ID,
    AUTH0_DOMAIN, {
      auth: {
        params: {
          scope: 'openid analyst offline_access'
        },
        redirect: false
      },
      closeable: false,
      autoclose: true
    })
  : null
export const client = authIsRequired
  ? new Auth0Client({
    clientID: AUTH0_CLIENT_ID,
    domain: AUTH0_DOMAIN
  })
  : null

/**
 * Use on application mount when authentication is required
 */
export function refreshUser (dispatch) {
  if (authIsRequired) {
    const userString = localStorage.getItem('user')
    const user = userString && JSON.parse(userString)
    if (user && user.refreshToken) {
      dispatch(setAuth0User(user))
      if (process.env.NODE_ENV !== 'development') {
        client.refreshToken(user.refreshToken, function (err, delegationResult) {

auth0-js

Auth0 headless browser sdk

MIT
Latest version published 2 months ago

Package Health Score

84 / 100
Full package analysis