Auth0 Home Blog Docs

Safari browser Login Page Issue

lock
auth0
login

#1

Hello Team ,

My lock window does not open safari browser, It always shows me loader and do nothing.
I am using below code. Which is working fine other browsers. Kindly help me in this

Auth.js

import Auth0Lock from ‘auth0-lock’;

const lock = new Auth0Lock(CONFIG.AUTH0_CLIENT_ID, CONFIG.AUTH0_DOMAIN, {
auth: {
redirectUrl: ${window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '')},
responseType: ‘token’
},
allowedConnections: [‘Username-Password-Authentication’],
autoclose: true,
closable: false,
loginAfterSignup: false,
allowSignUp: true,
signUpLink: ‘/signup’,
languageDictionary: {
title: ‘LicensingX’,
success: {
forgotPassword: ‘An email has been sent to reset your password.’
}
},
theme: {
labeledSubmitButton: true,
logo: “/images/favicon.png”,
primaryColor: “#174B6B”,
}
}
);

lock.on(‘authenticated’, authResult => {

setToken(authResult.idToken,authResult.accessToken);
// get user id from server
getUserByToken(authResult.accessToken).then((response) => {

if(response.response === "success"){
  setUserId(response.data);
  
  if(response.data.user_type !== CONFIG.USER_TYPES.Licensee) {
    browserHistory.push('/dashboard');
  } else {
    browserHistory.push('/dashboard/XXXX');
  }
  
} else {
  alert(response.message);
  logout();
}

});

});


#2

Hey there @rituraj.barhgoojer! Is there any errors being logged when the safari instance fails to open? Thanks!