【发布时间】:2013-03-15 11:31:59
【问题描述】:
所以我正在使用新的节点 MVC 框架 Sails.js (https://github.com/balderdashy/sails),我遇到了一个以前从未遇到过的奇怪错误。我正在尝试实施示例 passport.js 身份验证策略 (https://gist.github.com/theangryangel/5060446) Sails.js 包含在文档中,但是当我尝试在未登录的情况下访问我的主页 (http://localhost:1337/) 时,我被路由到 http://localhost:1337/login但它没有加载,chrome 给了我这个错误:
This webpage has a redirect loop
The webpage at http://localhost:1337/login has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
Here are some suggestions:
Reload this webpage later.
Learn more about this problem.
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
有人知道怎么回事吗?
【问题讨论】:
-
我完全不知道 Sails ,但是如果
authenticated策略也适用于/login,您可能会遇到重定向循环。跨度> -
在sails 1版本中遇到类似的事情,这个问题的解决方案是什么?
标签: javascript node.js sails.js