Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

restrictToRoles with custom id field #20

Closed
dottodot opened this issue Jul 10, 2017 · 1 comment
Closed

restrictToRoles with custom id field #20

dottodot opened this issue Jul 10, 2017 · 1 comment

Comments

@dottodot
Copy link

I've set my service up to use a custom id field but I can't seem to get it to work with restrict to roles.

restrictToRoles({
    roles: ['admin'],
    idField: '_id'
  })

gives an error of

_id is missing from current user.

and

    restrictToRoles({
      roles: ['admin'],
      idField: 'userid'
    })

gives an error of

userid is missing from current user.

Here's my service options.

  const options = {
    Model: user,
    id: 'userid',
    paginate: {
      default: 25,
      max: 25
    }
  };
@dottodot
Copy link
Author

Ok just updated

feathers-authentication
feathers-authentication-jwt
feathers-authentication-local

and it now works so there must have been a problem in one of those.

@daffl daffl closed this as completed Jul 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants