Skip to content

Commit

Permalink
Purge email and password fields after logging in and creating
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxwellBo committed Jan 10, 2021
1 parent c318352 commit c89318a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ export class Login extends React.Component<Props, State> {
this.setState({ loggingIn: true });

firebase.auth().signInWithEmailAndPassword(email, password).then(credential => {
this.setState({ loggingIn: false });
this.setState({
loggingIn: false,
email: '',
password: ''
});
logLogin(credential.user?.uid)
}).catch(err => {
this.setState({ loggingIn: false, error: err });
Expand All @@ -103,7 +107,12 @@ export class Login extends React.Component<Props, State> {
message: 'Your account was successfully created'
};

this.setState({ creating: false, success });
this.setState({
creating: false,
email: '',
password: '',
success
});
logCreateAccount(credential.user?.uid)
}).catch(err => {
this.setState({ creating: false, error: err });
Expand Down

0 comments on commit c89318a

Please sign in to comment.