Skip to content

Commit

Permalink
auto populate email for forgot password page (metabase#3273)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcwatt authored and kdoh committed Aug 29, 2016
1 parent 7f5072c commit 8f0efee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontend/src/metabase/auth/containers/ForgotPasswordApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class ForgotPasswordApp extends Component {
super(props, context);

this.state = {
email: null,
email: props.location.query.email || null,
sentNotification: false,
error: null
};
Expand Down Expand Up @@ -71,7 +71,7 @@ export default class ForgotPasswordApp extends Component {

<FormField key="email" fieldName="email" formError={error}>
<FormLabel title={"Email address"} fieldName={"email"} formError={error} />
<input className="Form-input Form-offset full" name="email" placeholder="The email you use for your Metabase account" type="text" onChange={(e) => this.setState({"email": e.target.value})} autoFocus />
<input className="Form-input Form-offset full" name="email" placeholder="The email you use for your Metabase account" type="text" onChange={(e) => this.setState({"email": e.target.value})} defaultValue={this.state.email} autoFocus />
<span className="Form-charm"></span>
</FormField>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/metabase/auth/containers/LoginApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default class LoginApp extends Component {
<button className={cx("Button Grid-cell", {'Button--primary': this.state.valid})} disabled={!this.state.valid}>
Sign in
</button>
<Link to="/auth/forgot_password" className="Grid-cell py2 sm-py0 text-grey-3 md-text-right text-centered flex-full link" onClick={(e) => { window.OSX ? window.OSX.resetPassword() : null }}>I seem to have forgotten my password</Link>
<Link to={"/auth/forgot_password"+(this.state.credentials.email ? "?email="+this.state.credentials.email : "")} className="Grid-cell py2 sm-py0 text-grey-3 md-text-right text-centered flex-full link" onClick={(e) => { window.OSX ? window.OSX.resetPassword() : null }}>I seem to have forgotten my password</Link>
</div>
</form>
</div>
Expand Down

0 comments on commit 8f0efee

Please sign in to comment.