express-stormpath icon indicating copy to clipboard operation
express-stormpath copied to clipboard

'/verify' 404 error

Open mdeggies opened this issue 9 years ago • 1 comments

Note: This is happening in multi-tenant scenarios where an Organization is the default account store, and has a directory/grouped mapped to it as a default account store.

According to the docs, /verify is enabled in the integration by default and can replace the default link base URL for the email verification workflow (https://api.stormpath.com/emailVerificationTokens to http://localhost:PORT/verify).

app.use(stormpath.init(app, {
}));

When I use the above config and turn on this workflow + set the link base URL to http://localhost:PORT/verify, I successfully receive an email verification link to http://localhost:PORT/verify?sptoken=$TOKEN, but I get a 404, Cannot GET /verify?sptoken=$TOKEN.

Enabling verifyEmail in the config fixes this:

app.use(stormpath.init(app, {
  web: {
    verifyEmail: {
      enabled: true
    }
  }
}));

mdeggies avatar Nov 30 '16 17:11 mdeggies

Just adding some context to this:

https://github.com/stormpath/express-stormpath/blob/master/lib/config.yml#L122

https://github.com/stormpath/stormpath-node-config/blob/824bab38af9a060a188da6c4b7dd525b42f62f54/lib/strategy/EnrichIntegrationFromRemoteConfigStrategy.js#L195

The issue seems to be that the directory.accountCreationPolicy.verificationEmailStatus is not being detected as ENABLED. Therefore setting verifyEmail.enabled to false.

typerandom avatar Dec 02 '16 09:12 typerandom