You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.
Hi, still reading through the docs and code, but struggling to make sense of it so far...
All I want is a user object populated in my middleware and all services where I use this strategy https://github.com/ripjar/passport-trusted-header to create my user object. First thing I'm stuck with is that in passport docs they do passport.use(), but that's not available in feathers-authentication.
I'm also confused whether I need all/any of these:
app.service('authentication').hooks({
app.service('users').hooks({
auth.express.authenticate('local'
let config = app.get('auth'); config.facebook.strategy = FacebookStrategy; app.configure(authentication(config))
In particular, I find these 2 snippets in the README quite confusing:
app.service('authentication').hooks({
before: {
create: [
// You can chain multiple strategies
auth.hooks.authenticate(['jwt', 'local'])
],
remove: [
auth.hooks.authenticate('jwt')
]
}
});
// Add a hook to the user service that automatically replaces
// the password with a hash of the password before saving it.
app.service('users').hooks({
before: {
find: [
auth.hooks.authenticate('jwt')
],
create: [
local.hooks.hashPassword({ passwordField: 'password' })
]
}
});
Does the first one mean - "make sure user is authenticated before... someone calls authentication.create"?
Or does feathers call authentication.create and this says "use jwt strategy"?
But then when would I pass "jwt" to this before hook and when would I pass it to express.auth.authenticate("jwt")
Is the fact that you show "jwt", "local" in create, but only "jwt" in the remove a demo of the feature or a recommended way of setting it up? Is this an example of some specific use case?
When do I need and not need to set these users/authentication hooks?
Do I ever need to manually use the services("authentication")?
I'm just hoping that these questions will ... shed some light on which bits confuse me so you guys can clarify ;) ✌️ Or maybe it's just me!
(I'm using feathers-authentication@next).
The text was updated successfully, but these errors were encountered:
Hi, still reading through the docs and code, but struggling to make sense of it so far...
All I want is a user object populated in my middleware and all services where I use this strategy https://github.com/ripjar/passport-trusted-header to create my user object. First thing I'm stuck with is that in passport docs they do
passport.use()
, but that's not available infeathers-authentication
.I'm also confused whether I need all/any of these:
app.service('authentication').hooks({
app.service('users').hooks({
auth.express.authenticate('local'
let config = app.get('auth'); config.facebook.strategy = FacebookStrategy; app.configure(authentication(config))
In particular, I find these 2 snippets in the README quite confusing:
I'm just hoping that these questions will ... shed some light on which bits confuse me so you guys can clarify ;) ✌️ Or maybe it's just me!
(I'm using
feathers-authentication@next
).The text was updated successfully, but these errors were encountered: