Skip to content
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

[Lock 10.5.0] Prefill fails when using username #685

Closed
CriGoT opened this issue Oct 27, 2016 · 0 comments
Closed

[Lock 10.5.0] Prefill fails when using username #685

CriGoT opened this issue Oct 27, 2016 · 0 comments
Labels
bug This points to a verified bug in the code
Milestone

Comments

@CriGoT
Copy link
Contributor

CriGoT commented Oct 27, 2016

Username prefill for username is not working in Lock 10.3, 10.4 and 10,.5. The problem si simple to reproduce

const cid = "ob7ZFXdikBMSFLWm0QzXzgv1CFeHuUiu";
const domain = "crigot-dev.auth0.com";
const options = {prefill:{username:'user'}};
const lock = new Auth0Lock(cid, domain, options);
lock.show();

The error is the following and points here

username.js:36Uncaught TypeError: Cannot read property 'getIn' of undefined
    at getUsernameValidation (http://localhost:3000/lock.js:43511:64)
    at setUsername (http://localhost:3000/lock.js:43519:53)
    at Classic.didInitialize (http://localhost:3000/lock.js:41436:73)
    at Auth0Lock.runHook (http://localhost:3000/lock.js:38894:41)
    at Object.runHook (http://localhost:3000/lock.js:39953:31)
    at setupLock (http://localhost:3000/lock.js:38956:9)
    at Auth0Lock.Base (http://localhost:3000/lock.js:38754:28)
    at new Auth0Lock (http://localhost:3000/lock.js:44096:51)
    at http://localhost:3000/:19:18

It seems that prefill is trying to use validation information about the connections before initializing the model. Since this value is passed by the user maybe validation can be skipped for this value.

    if (typeof username === "string") model = setUsername(model, username, null, false);

Otherwise, this has to be relocated to another stage where the database information is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

2 participants