accounts-react
accounts-react copied to clipboard
change-password empty page
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 ?
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.