Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setupClient(lockID, clientID, domain) {
// TODO: reuse clients
this.clients[lockID] = new Auth0({
clientID: clientID,
domain: domain,
sendSDKClientInfo: true
});
}
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) {