michaelkrone/generator-material-app

acl.user not found

Opened this issue · 9 comments

jsonwebtoken: expiresInMinutes and expiresInSeconds is deprecated. (/Users/victorcechinel/projetos/brcasp/app/server/lib/auth/auth.service.js:131:14) Use "expiresIn" expressed in seconds. POST /auth/local 200 34ms - 204b defaultErrorHandler /api/users/me 200 [Error: No active context found to set property request:acl.user] Error: No active context found to set property request:acl.user at Object.setContext (/Users/victorcechinel/projetos/brcasp/app/node_modules/request-context/lib/index.js:85:9) at addAuthContextMiddleWare (/Users/victorcechinel/projetos/brcasp/app/server/lib/auth/auth.service.js:164:20) at Layer.handle [as handle_request] (/Users/victorcechinel/projetos/brcasp/app/node_modules/express/lib/router/layer.js:82:5) at next (/Users/victorcechinel/projetos/brcasp/app/node_modules/express/lib/router/route.js:100:13) at next (/Users/victorcechinel/projetos/brcasp/app/node_modules/composable-middleware/lib/composable-middleware.js:40:9) at /Users/victorcechinel/projetos/brcasp/app/server/lib/auth/auth.service.js:98:9 at Query.<anonymous> (/Users/victorcechinel/projetos/brcasp/app/node_modules/mongoose/lib/model.js:3340:16) at /Users/victorcechinel/projetos/brcasp/app/node_modules/kareem/index.js:259:21 at /Users/victorcechinel/projetos/brcasp/app/node_modules/kareem/index.js:127:16 at nextTickCallbackWith0Args (node.js:419:9) at process._tickDomainCallback (node.js:389:13) GET /api/users/me 500 7ms

Login error

This repo wasn't finished(Notice the under heavy development) and didn't get any contributions for a long time.
This generator isn't used very much in my team, so I don't have the passion to complete this repo.
The author seems busy, too.

Recommendations:

  1. Find another generator/start-kit.
  2. Try node 4, npm 3.
  3. Try develop branch. If it works, fork this repo and maintain it yourselves. If not, try recommendation 1.

is there any help on this, another project using request-context, router and passport?
what did change so hard in mongoose update's
Why does the active context not initialize anymore?

i'm on this right now, and went through all of the code twice now.

Hi @tenchugecko,

I'am sorry you are facing problems with the generated code. This project has not seen any activity a long time, since I am very busy at the moment. I am willing to accept any pull requests or contributors, but since there are many better thought and much better supported AngularJS and Angular(2) generators out there, in all flavours and sizes, maybe you might port your code to those. I definitely should add a deprecation warning on the README. Sorry again.

Just to keep you motivated, I know it is possible to run request-context, router and passport, even if it does not help you much.
Maybe you hit michaelkrone/request-context#17
Try request-context in a version below 1.0.0!

This thing broke when i updated mongoose from 4.2.6 to 4.7.6
the global bluebird promise didnt change anything :(

Die you try setting mongoose.promise = require ('bluebird')?

forked and updated all of my project
-) jwt expireInMinutes => change to: expiresIn
-) Cannot read property 'model' of undefined in the controllers (this.model)
=>seems like prototyping class stuff.
-) mongoose.promise didnt help on the context, when used in the model.
didnt find the "global way" yet
-) mongoose populate doesnt work correctly

time will solve this.
:)

pleas give me a hint if you can: why is "this" not avaiable in the .prototype

defaultErrorHandler /api/users 200 TypeError: Cannot read property 'omit' of undefined
at index (G:_soundsets_projects\SoundSetsWebAdmin\sswa_updated\server\lib\controllers\crud.controller.js:101:11)
......

so i need to bind things: got the user route to work again
http://stackoverflow.com/questions/34680450/this-is-undefined-in-expressjs-route-handler
server/api/user/index.js:

router.route('/').get(isAdmin, controller.index.bind(controller))

and in the controller class constructors somewhere
this.index = this.index.bind(this);