import React, {Component} from 'react'; import {Button, Form, Grid, Header, Image, Icon, Message} from 'semantic-ui-react'; import { call } from '../client_server'; export default class ChangePass extends Component { constructor(props) { super(props); this.state = { password: "", error: { state: false, message: "", } } } onChangeHandler = (event) => { let nam = event.target.name; let val = event.target.value; this.setState({[nam]: val}); }; checkpassword = (e) => { if (e.target.value !== this.state.password) { this.setState({error: { state : true, message : "Passwords do not match.", }}); } }; handleChangePassword = (e) => { const params = { "confirmationToken" : this.props.query.confirmationToken , "password" : this.state.password } call.resetPassword(params) .then(res => { if (res.status === "Errore") { this.setState({ error: { state: true, message: "Errore"}}); } // else set a message that an email has been sent }).catch(err => { console.log(err); }); }; render() { return (
Reset Password
) } }