accounts-react icon indicating copy to clipboard operation
accounts-react copied to clipboard

change-password empty page

Open rfrancois opened this issue 7 years ago • 1 comments

Hi,

I tested the package with this code :

import React, { Component } from 'react'
import { Redirect } from 'react-router'
import { Route, Switch } from 'react-router-dom'
import { AccountsReactComponent } from 'meteor/meteoreact:accounts'


class Authentication extends Component {

  render () {
	const arState = this.arState

	return (
	  <Switch>
		<Route exact path='/sign-in'          component={arState} />
		<Route exact path='/sign-up'          component={arState} />
		<Route exact path='/forgot-password'  component={arState} />
		<Route exact path='/change-password'  component={arState} />
		<Route exact path='/reset-password/:token' component={arState} />
		<Route exact path='/resend-verification'   component={arState} />
	  </Switch>
	)
  }

  arState = ({ match, history }) => {
	const { path, params } = match

	// Cant change password if not logged in.
	if (Meteor.userId() && path !== '/change-password') {
	  return (<Redirect to='/' />)
	}

	return (
	  <AccountsReactComponent
		history={history}
		route={path}
		token={params.token} // for the reset-password route
	  />
	)
  }
}

export default Authentication

I tired to log in and sign up, but when I go to the url /change-password, it does not show anything. Do I miss something ?

rfrancois avatar Nov 20 '18 10:11 rfrancois

I had the same problem. Have a look if the enablePasswordChange option is set to true. It seems in version 1.2.3 this is set to false by default, and 1.2.4 is not published yet.

opyh avatar Mar 04 '19 13:03 opyh