I've been adding user account functionality into a Meteor + React App.
For the login, using Meteor.loginWithPassword, I'm getting no indication of any special exception or crash in the server log. Yet, the callback never gets invoked.
Seen above "Login Requested" will post in the console.
But "Login Processed" never does, showing that the callback is never executed.
accounts-ui as well as accounts-passwords have been added to meteor.
Subscriptions still work, so I'm not sure what's causing this to fail.
I'd at least expect some exception to get thrown on the server side as well, but I'm getting no apparent information on what's happening. Here is my React code:
import React from 'react';
import Meteor from 'meteor/meteor'
import { Input, Button } from 'react-onsenui'
class LoginPage extends React.Component{
constructor(props) {
super(props);
this.state = {
username: "",
password: "",
};
}
loginRequest(){
console.log("Login Requested")
Meteor.loginWithPassword(this.state.username, this.state.password, function(error){
console.log("Login Processed");
});
}
render(){
return (
<form className="LoginPage">
<p>
<Input
value={this.state.username} float
onChange={(event) => { this.setState({username: event.target.value})} }
modifier='material'
placeholder='Username' />
</p>
<p>
<Input
value={this.state.password} float
onChange={(event) => { this.setState({password: event.target.value})} }
modifier='material'
placeholder='Password' />
</p>
<Button onClick={this.loginRequest.bind(this)} modifier="large--cta">Login</Button>
</form>
)
}
}
export default LoginPage;