Closed ppitonak closed 7 years ago
Hey @ppitonak, I tried to repro this but could not. I tested using the express-stormpath sample project. Can you provide any further info (eg what versions of node/npm/ubuntu are you running?) Feel free to link me to your project if it's available so I can take a look, or send it over to support@stormpath.com.
Hi,
you can reproduce it using https://github.com/ppitonak/express-stormpath-sample-project/tree/542-cookie-parser
@ppitonak- thanks for sending that over. It looks like cookie-parser can only be invoked once (see lines 41-43 here). Since our library invokes & configures it, you can't use your own. :/ @robertjd suggested a fix would be refactoring our code to not rely on the req.cookies state.
It works fine if user initializes cookie-parser with password so IMHO it is enough to update docs
I'm developing an app using the React Starter Kit (https://github.com/kriasoft/react-starter-kit) and have added Stormpath through express-stormpath. I'm not using the React library because I'm not using react-router in my project.
I just started getting this error from our AWS testing deployment's login page (register still renders fine):
Error: cookieParser("secret") required for signed cookies
- set-temp-cookie.js:20 Object.module.exports [as setTempCookie]
[app]/[express-stormpath]/lib/helpers/set-temp-cookie.js:20:7
- login.js:94 helpers.handleAcceptRequest.text/html
[app]/[express-stormpath]/lib/controllers/login.js:94:15
- handle-accept-request.js:59 Object.handleAcceptRequest
[app]/[express-stormpath]/lib/helpers/handle-accept-request.js:59:3
- login.js:27 module.exports
[app]/[express-stormpath]/lib/controllers/login.js:27:11
- body-parser.js:41 forceDefaultBodyMiddleware
[app]/[express-stormpath]/lib/helpers/body-parser.js:41:7
- get-user.js:173
[app]/[express-stormpath]/lib/middleware/get-user.js:173:16
I tried adding a password to my cookieParser('secret') invocation, and I tried removing cookieParser() all together, neither will clear the error from AWS. What gets me is that my local environment works just fine and it authenticates to the same Stormpath directory.
EDIT: I just double-checked my express-stormpath versions and I was on 3.1.6 on AWS and 3.15 locally.
Hello @ppitonak and @VimCommando , please see the new 3.1.7 release, it should fix this problem for you. Please re-open this issue if the problem persists. Thanks!
This error is displayed/logged: