daily pastebin goal
90%
SHARE
TWEET

Untitled

a guest Jan 24th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. handleResetPassword = () => {
  2.  const { email } = this.state
  3.  this.context.auth
  4.   .sendPasswordResetEmail(email)
  5.   .then(() => {
  6.     console.warn('Email is sent')
  7.     this.setState({
  8.       ...this.state,
  9.       type: 'success',
  10.       header: 'Email is sent',
  11.       errorMessage:
  12.         'Please check your email in order to change the password',
  13.       password: ''
  14.     })
  15.   })
  16.   .catch(error => {
  17.     const { message } = error
  18.     const errorMessage = !email ? 'Please enter an email address' : message
  19.     this.setState({
  20.       ...this.state,
  21.       type: 'error',
  22.       header: 'Email is not sent',
  23.       errorMessage: errorMessage
  24.     })
  25.   })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top