Open davd33 opened 8 years ago
Having the same issue, happened after updating to senecajs 3.2.2
The same for me.
Can someone look into this?
Hi, @mihaidma, @rjrodger
Is it possible to address this?
I can't upgrade to the latest version of Senecajs unless this is fixed.
help will be much appreciated.
Having the same issue here too :(
It looks as though there was quite a fundamental change between seneca-web 0.8.0 and 1.0.0; I will take a look into what changes are needed for seneca-auth to work with the new version.
Providing custom middleware to seneca-web
, which this module does for initializing passport and the like, is no longer possible with the latest version of seneca-web
.... it now has its own way to do auth that makes seneca-auth
redundant, however it requires more configuration of the web server ahead of time to use it.
Both the express and hapi adapters support an auth key provided to routes, and additional config keys passed to the routemap which provide for additional configuration.
for express -- You can take a look at the secure-route.test.js
in seneca-web-adapter-express for an example of how to set up the express app and seneca-web config to use auth with passport.
for hapi -- I haven't gotten around to adding tests for the hapi adapter, but it works in a similar fashion but in the hapi way; instead of passport you might use something like hapi-auth-basic
and configure the server to use it, keyed by a name -- pass that same name as the auth key in route config. See the auth tutorial and the authRoute
definition in the hapi adapter
That said, in my own projects I usually use express and will configure the app myself with custom middleware attached to the seneca-web context and bypass the auth setup in seneca-web entirely. I prefer a more fine-grained approach that includes authorization, and response codes instead of redirects; as long as req.user
is set, it will make its way to the seneca actions.
--
If you want to upgrade to the latest version of seneca
, and still use seneca-auth
, you can probably do so, but you'll need to stick to the old seneca-web
-- if you have it installed as a dependency at version 0.8.x, seneca-auth
should continue to work.... seneca 3 removed the 0.x seneca-web
dependency -- but that's not to say you can't use
it yourself. I haven' tested 0.x of seneca-web with seneca3, but I don't see why it wouldn't work.... Of course, going this route means you need to use the old seneca-web
as well.
Thanks, @tswaters! I used the express + passport solution (took a bit of work but it works fine). I think this information should be added to the readme file.
Hello, I'm having the following issue:
Here's my code: https://gist.github.com/davd33/4bc128cf23df789fe2c0bc0b8a322422
How can I solve this issue?