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
// Add this to set abilities, if a user existscontext=>{if(context.params.ability){returncontext;}// for socket.io connectionsconst{ user }=context.paramsif(user)context.params.ability=defineAbilitiesFor(user)returncontext}
Explanation: @feathersjs/express does not seem to map the result from authentication onto the context.params object, like @feathers/socket.io does. Maybe that should be fixed in @feathersjs/express. Don't even know where the magic happens in the source code of @feathersjs/authentication.
The note about rest could be more present, of course. Let me know, if it works.
If you got an idea how that note could be better highlighted, please let me know. Maybe in the Gotchas section.
When configuring
feathers-casl
I ran into a problem when authenticating with@feathersjs/authentication
:You're not allowed to get on 'users'
The responsible code that calls
get
withprovider
set should be:https://github.com/feathersjs/feathers/blob/d14f57ed8316c89ffde85c9acb17ecd790e454c5/packages/authentication/src/jwt.ts#L112
Steps to reproduce
lukashass/feathers-chat-ts@a0e2604
Possible fix
My current approach to fix this would be to explicitly add the ability with a hook on
users.get
, just like https://feathers-casl.netlify.app/getting-started.html#using-casl-with-the-rest-express-js-transport.Maybe there is even an easy fix that could be applied in
feathers-casl
?System configuration
Module versions:
This occurred while using
dove
but the linked reproduction is:NodeJS version: v16.13.1
The text was updated successfully, but these errors were encountered: