New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v11 is noticably slower than v10 #1227
Comments
when is the slow down happening? on start? are you using the |
Yes, it happens on start, when trying to display the login dialog. It waits for two calls to |
Hm, so I fixed that by also adding |
can you paste your initialization code? |
function create (options) {
var state = options.state;
var loginGoogle = E.isTrue((E.find(state.entity.organizationSetting, R.propEq('key', 'loginGoogle')) || {value: 'true'}).value); // Note: default is True
var logo = (E.first(state.entity.organization) || {}).logoUrl || '/static/dashboard/asset/logo/logo.png';
var languageDictionary = Object.assign({
passwordInputPlaceholder: buildPasswordInputPlaceholder(options),
title: (E.find(state.entity.organizationSetting, R.propEq('key', 'loginTitle')) || {}).value || config.product.name
}, {
databaseSignUpInstructions: 'Choose your personal password and click Sign Up'
}, buildLanguageDictionary(state));
var lockOptions = {
allowedConnections: [
loginGoogle ? 'google-oauth2' : null,
'Username-Password-Authentication'
],
allowLogin: options.allowLogin,
allowSignUp: options.allowSignUp,
auth: {
params: {
scope: 'openid email' // Note: ensure that email is included in the JWT so we can decode and extract server side without having to query auth0 servers
}
},
autofocus: true,
initialScreen: config.feature.optimizedLogin ? undefined : options.signup ? 'signUp' : 'login',
languageDictionary: languageDictionary,
prefill: options.email ? {email: options.email} : {},
rememberLastLogin: false,
avatar: null
theme: {
logo: logo,
primaryColor: variable.secondaryColor
}
};
/* eslint-disable new-cap */
lock = new Auth0Lock.default(config.auth0.clientId, config.auth0.domain, lockOptions);
/* eslint-enable new-cap */
lock.on('unrecoverable_error', function (err) {
console.error('auth0 unrecoverable_error', err);
});
lock.on('authenticated', function (authResult) {
options.onAuthenticated(authResult);
});
}
function show () {
lock.show({gravatar: false});
} |
Thanks. That's pretty normal. Can you send a print screen of the requests being made? You can filter only *auth0.com requests. On initialization, we fetch the client configuration from cdn.auth0.com. That's the only request we should make in your case |
The red circle is the time where the dialog appears. |
Right, so, we're doing an authorize call in an iframe that returns a 400 response. Since we can't know when the iframe has an error, we wait 5s to throw the error. You can inspect the 400 response error to see what's going on with that particular request. It's probably a configuration issue. When you fix the configuration, it will be pretty fast. If, instead, you want to disable that call altogether, you can disable sso like this: If you want to disable that authorize call, you can add this to your options:
|
Thank you, that did the trick! But is there no way around this thing if using SSO? |
See what error that authorization request is showing and fix it. To see the error, you can click the link, it will show an error page, then you click to "see more". It should have enough info. |
Okay, I'll investigate. Thank you for your help! |
Depending on the error, you can also see it in the logs section of the Auth0 dashboard |
Yup luis, that indeed improved the loading time considerably. Thanks a lot! |
After upgrading to the V11 lock, we are noticing a significant slowdown when showing the lock. Is this a known difference or might we be doing something wrong in the configuration?
The text was updated successfully, but these errors were encountered: