0
我有下面的代码从这个优秀的资源借:http://scotch.io/tutorials/javascript/easy-node-authentication-setup-and-local#handling-signup/registrationPassportjs(成功登录后)
app.post('/signup', passport.authenticate('local-signup', {
successRedirect : '/profile', // redirect to the secure profile section
failureRedirect : '/signup', // redirect back to the signup page if there is an error
}));
,但我不希望使用successRedirect
或failureRedirect
我的前端是一个Angularjs应用。如果注册成功,我想告诉我的Angularjs前端,但我该怎么做?
感谢您 - 所以您认为我应该将auth逻辑移出我单独的passport.js文件并放入我的routes.js文件中? – tommyd456
不需要'本地注册'是认证过程的命名策略。每篇文章passport.use('local-signup',新的LocalStrategy({...所以当你调用passport.authenticate('local-signup')它会寻找该策略并使用该过程设置。 –
一个愚蠢的问题但是为什么在Passport中有一个注册认证过程?如果我自己制作系统,那么我们在注册之前不会对用户进行认证,它们在注册时是否记录下来? – tommyd456