Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

default.json contains wrong entity/service if a different user model is used during app generation #199

Closed
bastibense opened this issue Nov 13, 2019 · 2 comments

Comments

@bastibense
Copy link

Steps to reproduce

  1. Create a new app using feathers generate app
  2. Pick a different model name for the authentication (other than 'users')

Expected behavior

default.json should contain the correct entity and service names instead of 'user' and 'users'.

"authentication": {
    "entity": "account",
    "service": "accounts",
    ...
}

Actual behavior

default.json always contains 'user' and 'users', which leads to problems when trying to run the app using npm run.

"authentication": {
    "entity": "user",
    "service": "users",
    ...
}

System configuration

Module versions (especially the part that's not working):
feathers 4.3.11

NodeJS version:
v10.16.3

Operating System:
macOS/Linux

@davison
Copy link

davison commented Nov 25, 2019

I just hit the same issue, and found that I had to modify code in authentication.test.js too to make the tests pass..

     });
 
     it('authenticates user and creates accessToken', async () => {
-      const { user, accessToken } = await app.service('authentication').create({
+      const { account, accessToken } = await app.service('authentication').create({
         strategy: 'local',
         ...userInfo
       });
       
       assert.ok(accessToken, 'Created access token for user');
-      assert.ok(user, 'Includes user in authentication data');
+      assert.ok(account, 'Includes user in authentication data');
     });
   });
 });```

@daffl
Copy link
Member

daffl commented Jul 8, 2020

@daffl daffl closed this as completed Jul 8, 2020
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

3 participants