disable stormpath's Create account option in the login screen

╄→гoц情女王★ 提交于 2019-12-01 18:03:54

问题


I want to disable the create account in the stormpath login screen. The call to the api should already be made from a user authenticated to the app. I tried setting stormpathEnableRegistration to false but the registration functionality is still enabled.

  app.use(stormpath.init(app, {
     apiKeyFile: config.stormpathapi.apiKeyFile,
     application: config.stormpathapi.application,
     secretKey: config.stormpathapi.secretKey,
     sessionDuration: 1000 * 60 * 30,
     enableAutoLogin: true,
     enableUsername: true,
     stormpathEnableRegistration: false
  }));

Thanks!


回答1:


I'm the author of the express-stormpath library, sorry this was confusing.

Here's what you need to do:

  1. Rename stormpathEnableRegistration -> enableRegistration.
  2. Update to the latest release of the library.

I just pushed a change in the latest release which fixes a rendering issue on the login page when this setting is disabled. What used to be happening was this:

  • You'd disable registration.
  • The registration page wouldn't work.
  • But the login page would still render a 'Create Account' link.

In the latest release this is fixed =)

UPDATE: Since the 2.x.x release of express-stormpath is now out, the above information is no longer valid. Instead, you should do this:

app.use(stormpath.init(app, {
  client: {
    apiKey: {
      file: config.stormpathapi.apiKeyFile
    }
  },
  application: {
    href: config.stormpathapi.application
  },
  web: {
    register: {
      enabled: false
    }
  }
}));

This will disable the registration functionality for you =)



来源:https://stackoverflow.com/questions/27915388/disable-stormpaths-create-account-option-in-the-login-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!