doronnahum / feathers-mongoose-casl

Easily create a Mongoose Service for Feathersjs with casl to handle what resources a given user is allowed to access
MIT License
7 stars 6 forks source link

Generate a user is broken in 2.1.11 #22

Closed chrisLovesCode closed 4 years ago

chrisLovesCode commented 4 years ago

Hi, with version 2.1.6 generatig a user works. with the current version 2.1.11 to which i updated, it throws an 500 error. With logging i found out that it's caused by the two lines with const isFirstUSer = context.app.get('firstUsers').includes(context.params.userRequest.email) inside of the users.hooks.js of feathers-mongoose-casl. which got added in version 2.1.9

context.app.get('firstUsers') is undefined. As far as i understand there should be a service called "firstUsers" ? for me it looks like this service is just missing.

it can be reproduced switching back and forth between 2.1.6 and 2.1.11

doronnahum commented 4 years ago

Hi, firstUsers is array of emails that you need to add to your config file config/default.json firstUsers:["myemail@gmail.com"]

chrisLovesCode commented 4 years ago

Oh, okay, this was new :D solved