Heroku Stormpath无响应注册页面

时间:2016-03-19 17:07:55

标签: node.js express heroku mean-stack stormpath

我已按照heroku指南here在我的角度网站上使用express.js配置stormpath身份验证。我成功地能够导航到我站点根目录下的/ login和/ register页面。但是,当我尝试注册时,我总是没有创建用户,我的页面看起来像下面的图像。

enter image description here

2 个答案:

答案 0 :(得分:1)

问题实际上是我试图将stormpath添加到已经配置为单页面应用程序(角度)的网站。为此,您需要包含以下内容

app.use(stormpath.init(app, { 
   web: {
      spa:{
         enabled: true,
         view: path.join(__dirname, 'public', 'index.html')
      }
   }
} 

将“public”替换为您的单页应用程序目录,并相应地替换“index.html”

在express-stormpath文档here

中找到了答案

答案 1 :(得分:0)

环境变量可能存在问题,我们的文档说您应该在heroku应用程序中看到这些变量:

heroku config | grep STORMPATH
STORMPATH_API_KEY_ID:      5IFE9WD86423ZPOV8IEXAMPL
STORMPATH_APKI_KEY_SECRET: 0Fx+Ebqns9OWBO5lbHce6FAYTUtnSpYwcQ+DEXAMPLE
STORMPATH_URL:             https://api.stormpath.com/v1/applications/YoUrStOrMPaThApPlICAtiOnId

但是,我们的express-stormpath库期望STORMPATH_URLSTORMPATH_APPLICATION_HREF。您可以尝试将环境中的STORMPATH_APPLICATION_HREF变量设置为Stormpath应用程序的HREF吗?谢谢!附:我在Stormpath工作:)

相关问题