Mongoose-Auth(everyauth):如何在成功时呈现视图

时间:2011-12-12 11:04:04

标签: node.js everyauth

只是没有得到如何在提供商(Facebook等)的成功身份验证中进行自定义响应(发送或呈现):

handleAuthCallbackError 方法有请求和重置参数,我可以这样做:response.render或response.send

findOrCreateUser 没有响应参数来呈现或发送自定义内容,而 redirectPath 只是执行重定向。

感谢。

1 个答案:

答案 0 :(得分:1)

我想你想听respondToLoginSucceedrespondToRegistrationSucceed。它们都有响应参数。

编辑执行此操作的正常方法是调用.redirectPath('/yay/login/succeeded');并以正常方式在Express中注册。

app.get("/yay/login/suceeded", function (req, res) {
    // do custom headers
});

你想这样做的原因是你有一个可以刷新的状态免费页面等没有任何副作用。