import React from 'react'; import TextField from 'material-ui/TextField'; import QueueAnim from 'rc-queue-anim'; import RaisedButton from 'material-ui/RaisedButton'; class ResetPassowrd extends React.Component { constructor() { super(); this.state = { validated:false, }; this.buttonValidated = this.buttonValidated.bind(this); this.handlePass = this.handlePass.bind(this); this.handleConfirmationPass = this.handleConfirmationPass.bind(this); this.clickEvent = this.clickEvent.bind(this); } buttonValidated = () => { let validated = true; if (!this.state.password_validated || !this.state.pass || this.state.pass === null || this.state.pass === "") validated = false; this.setState(Object.assign(this.state, { validated: validated })); } handlePass = (event) => { this.setState(Object.assign(this.state, { pass: btoa(event.target.value) })); this.setState(Object.assign(this.state, { password_validated: this.state.pass === this.state.passConfirmation })); }; handleConfirmationPass = (event) => { this.setState(Object.assign(this.state, { passConfirmation: btoa(event.target.value) })); this.setState(Object.assign(this.state, { password_validated: this.state.pass === this.state.passConfirmation })); }; clickEvent = (event) => { location.href = '/#/login'; /* event.preventDefault(); const state = this; let user = { "provider": { "org_name": this.state.provider_name, "internal_id": this.state.provider_npi }, "name": this.state.first + ' ' + this.state.last, "first": this.state.first, "last": this.state.last, "email": this.state.email, "phonenumber": this.state.phone_number, "pass": this.state.pass, }; Instance.setToken(null).post('/v1/selfregister/', user).then(function (res) { localStorage.removeItem('loggedUser'); location.href = '/#/login'; }).catch(function (err) { if (err.response.status === 422) { //Unprocessable Entity (validation failed) state.setState(Object.assign(state.state, { showValidationErrors: true, validationErrors: err.response.data.data })); } else { alert('Error to log in: ' + err.message); } console.error(err); }); */ } render() { return (

Reset Password

); } } const Page = () => (
); module.exports = Page;