Skip to content

Commit

Permalink
only set prefill values when client is initialized. fix #854
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Deschamps Rudge authored and Luis Deschamps Rudge committed Feb 3, 2017
1 parent 8629c09 commit 2c26a4e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/engine/classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,16 @@ class Classic {
model = initSocial(model, options);
model = initDatabase(model, options);
model = initEnterprise(model, options);

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;

return model;
}

didReceiveClientSettings(m) {
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);
}

Expand Down

0 comments on commit 2c26a4e

Please sign in to comment.