Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example cookie does not work #43

Closed
mattma opened this issue Aug 12, 2016 · 5 comments
Closed

Example cookie does not work #43

mattma opened this issue Aug 12, 2016 · 5 comments
Assignees

Comments

@mattma
Copy link
Contributor

mattma commented Aug 12, 2016

Running cookie example, I clicked on "remember" checkbox, then submit. It routes to /remember route, none of the logic in remember route is being run due to error secret is missing. See the full error log

2016-08-11 23:52:47,376 INFO 10862 [-/::1/-/8ms GET /] status 200 (rt: 8ms)
2016-08-11 23:52:49,389 WARN 10862 [-/::1/-/15ms POST /remember] nodejs.ForbiddenError: secret is missing
    at Object.module.exports.throw (/Users/mattma/Desktop/egg/egg/node_modules/koa/lib/context.js:91:23)
    at Object.context.assertCSRF.context.assertCsrf (/Users/mattma/Desktop/egg/egg/node_modules/koa-csrf/index.js:69:30)
    at Object.csrf (/Users/mattma/Desktop/egg/egg/node_modules/egg-security/lib/middlewares/csrf.js:39:12)
    at next (native)
    at Object.<anonymous> (/Users/mattma/Desktop/egg/egg/node_modules/koa-compose/index.js:29:12)
    at next (native)
    at onFulfilled (/Users/mattma/Desktop/egg/egg/node_modules/co/index.js:65:19)
    at /Users/mattma/Desktop/egg/egg/node_modules/co/index.js:54:5
    at Object.co (/Users/mattma/Desktop/egg/egg/node_modules/co/index.js:50:10)
    at Object.toPromise (/Users/mattma/Desktop/egg/egg/node_modules/co/index.js:118:63)
@popomore
Copy link
Member

I have disabled csrf in #44

You can try it again.

@mattma
Copy link
Contributor Author

mattma commented Aug 18, 2016

Running in the branch of egg-core.

here is the error message:

assert.js:90
  throw new assert.AssertionError({
  ^
AssertionError: options.customEgg is required
    at module.exports (/Users/mattma/Desktop/egg/egg/node_modules/egg-cluster/lib/utils/options.js:23:3)
    at Master (/Users/mattma/Desktop/egg/egg/node_modules/egg-cluster/lib/master.js:35:20)
    at Object.exports.startCluster (/Users/mattma/Desktop/egg/egg/node_modules/egg-cluster/index.js:20:3)
    at Object.<anonymous> (/Users/mattma/Desktop/egg/egg/examples/cookie/dispatch.js:5:5)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.runMain (module.js:575:10)

It looks like every example project, even helloworld, failed on this error which came from egg-cluster.

BTW, I saw in the beta version of egg@0.1.0-beta.4. Is it the latest? Do you have an issue to track what is the latest? Hope @popomore #44 can be merged into the master soon so that we could have the latest greatest egg-core.

@popomore
Copy link
Member

Maybe it's a bug for the examples.

#44 is developing, and plugins need the new API to test, so I release beta version for it.

@popomore
Copy link
Member

popomore commented Aug 18, 2016

I have fixed on a20b202a408c357537f286790ab9f9134baef741, you can use this branch to test again.

@mattma
Copy link
Contributor Author

mattma commented Aug 19, 2016

Your latest release 1.0 has fixed the issue permanently. All examples are working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants