jaredhanson/passport-local

How to get the username and password when auth fail?

sword-jin opened this issue · 0 comments

This is my route

router.post('/login',
  passport.authenticate('local', {
    failureRedirect: '/auth/login',
    failureFlash: 'username and password not match'
  }),
  (req, res, next) => {
    console.log('success');
    req.flash('success', Login successful')
    res.redirect('/')
  }
)

my template is, i use ejs as template.

<div class="form-group">
      <label for="email">Email</label>
      <input type="email" name="email" class="form-control" id="" placeholder="Enter your email" value="<% if (typeof email != 'undefined') { %><%= email %><% } %>">
    </div>
    <div class="form-group">
        <label for="password">Password</label>
        <input type="password" class="form-control" name="password" id="password" placeholder="Enter your password">
    </div>

how i can get the username and password, thet story in session?