1
passport-local을 사용할 때 (예제 데이터베이스) 오류에 대한 cutom 페이지로 리디렉션하고 메시지를 표시하는 방법. 여기 코드는 다음과 같습니다 passport-local에서 오류가있는 페이지로 리디렉션하는 방법
app.post('/auth/local', passport.authenticate('local', {
successRedirect: '/',
failureRedirect: '/',
failureFlash: true
}));
오류가 발생
이 URL이 더러운[object Object]
내용으로,
/auth/local
을 유지 : 같은
passport.use(new LocalStrategy({
passReqToCallback: true
}, function(req, username, password, done) {
done({error:'mycustomerrormessage'});
}
));
라우팅 보인다.
나는 여권보다 더
done(null, false, { message: "error message"})
이 /
로 리디렉션, 나는 메시지를 flash
수 있지만이 경우 리디렉션을 설정하는 방법은 내가 먼저하지 null
매개 변수와 함께 verify
함수를 호출하고 무언가를 호출하는 경우 그 오류는?