-
Notifications
You must be signed in to change notification settings - Fork 556
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
Only set prefill values when client is initialized #855
Conversation
src/engine/classic.js
Outdated
const { email, username } = options.prefill || {}; | ||
if (typeof email === "string") model = setEmail(model, email); | ||
if (typeof username === "string") model = setUsername(model, username, "username", false); | ||
this.prefill = options.prefill; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of adding state to the engine, I would put the prefill data into the model and get in from there. this way this keeps stateless and dependent only on the model
src/engine/classic.js
Outdated
const { email, username } = this.prefill || {}; | ||
if (typeof email === "string") m = setEmail(m, email); | ||
if (typeof username === "string") m = setUsername(m, username, "username", false); | ||
|
||
return validateAllowedConnections(m); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should set the email before this, so the connection check runs over the allowed ones
src/core/index.js
Outdated
@@ -38,11 +38,12 @@ export function setup(id, clientID, domain, options, hookRunner, emitEventFn) { | |||
hashCleanup: options.hashCleanup === false ? false : true, | |||
allowedConnections: Immutable.fromJS(options.allowedConnections || []), | |||
ui: extractUIOptions(id, options), | |||
defaultADUsernameFromEmailPrefix: options.defaultADUsernameFromEmailPrefix === false ? false : true | |||
defaultADUsernameFromEmailPrefix: options.defaultADUsernameFromEmailPrefix === false ? false : true, | |||
prefill: Immutable.fromJS(options.prefill || {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe dont wrap it? if you will end up unwrapping if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
fix #854