Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form onSubmit={this.handleLogin.bind(this)} action="/" method="post">
- <div>
- <label>Username:</label>
- <input type="text" name="username"/>
- </div>
- <div>
- <label>Password:</label>
- <input type="password" name="password"/>
- </div>
- <div>
- <input type="submit" value="Log In"/>
- </div>
- </form>
- handleLogin(){
- fetch('http://localhost:8080', {
- method: 'post',
- body: JSON.stringify({
- username: this.state.username,
- password: this.state.password
- })
- })
- }
- app.post('/', function(req, res, next) {
- console.log("post");
- passport.authenticate('register', function(err, user, info) {
- console.log("authenticate");
- })(req, res, next);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement