Closed grawk closed 9 years ago
We should probably finish out the role based access control in the example.
The role based access control does work, but as you (@aredridel) had mentioned in the thread under the original bug, some of the refactoring was left undone. I had refactored the role checking to read from req.user.role
but not removed this inline middleware call.
This is copied from https://github.com/krakenjs/kraken-examples/issues/42 on the original combined example repository. Will fix it here and close both once fixed. Please track progress here.
Original issue description from @klall
In https://github.com/krakenjs/kraken-examples/blob/master/with.passport/controllers/index.js#L27
this line exists:
However, parameters such as 'admin' are not really used in https://github.com/krakenjs/kraken-examples/blob/master/with.passport/lib/auth.js#L57
As well don't we already invoke
isAuthenticated
for each route?https://github.com/krakenjs/kraken-examples/blob/master/with.passport/config/config.json#L89
If I change the line to:
the code should work as expected no?