【问题标题】:Why might "auth/twitter"be missing from my NodeJS routes?为什么我的 NodeJS 路由中可能缺少“auth/twitter”?
【发布时间】:2012-04-21 10:05:52
【问题描述】:

我正在开发一个小型 NodeJS 应用程序,该应用程序使用everyauth(技术上是 mongooseAuth)与 twitter 对话以验证用户身份。我已经按照 mongooseAuth 的说明以及用户模型设置了 UserSchema,并在我的 app.configure 部分中包含了 app.use(mongooseAuth.middleware())。

当我单击“使用 Twitter 登录”按钮时,它会尝试转到 http://localhost:3000/auth/twitter,但根据显示的错误,这条路线丢失了:

Cannot GET /auth/twitter

据我所知,这个 url 应该由everyauth/mongooseAuth 提供。我一直在寻找答案,但到目前为止没有任何帮助。这个应用程序使用快递。想法?我是 NodeJS 的新手。

【问题讨论】:

    标签: node.js everyauth


    【解决方案1】:

    原来使用http://localhost:3000 代替http://local.host:3000 导致了这个错误。使用其他身份验证(例如 google),此问题不再发生。

    【讨论】:

      猜你喜欢
      • 2019-01-09
      • 2021-04-15
      • 2019-11-14
      • 2011-07-21
      • 2021-12-02
      • 1970-01-01
      • 2015-11-14
      • 2018-09-20
      • 1970-01-01
      相关资源
      最近更新 更多