Skip to content
This repository was archived by the owner on Aug 29, 2018. It is now read-only.

Clean generated project throws Error: You must provide a 'header' in your authentication configuration #35

Closed
georgeedwards opened this issue Sep 12, 2017 · 1 comment

Comments

@georgeedwards
Copy link

When generating a clean project, with v2.3.6 of the cli - i.e.

>feathers generate app
>feathers g authentication
>yarn start

you get the issue Error: You must provide a 'header' in your authentication configuration or pass one explicitly, here is the full log you get:

yarn start v1.0.1
$ node src/
You are using the default filter for the users service. For more information about event filters see https://docs.feathersjs.com/api/events.html#event-filtering
C:\Users\George\Source\Repos\ts4\node_modules\feathers-authentication-jwt\lib\index.js:58
      throw new Error('You must provide a \'header\' in your authentication configuration or pass one explicitly');
      ^

Error: You must provide a 'header' in your authentication configuration or pass one explicitly
    at EventEmitter.jwtAuth (C:\Users\George\Source\Repos\ts4\node_modules\feathers-authentication-jwt\lib\index.js:58:13)
    at EventEmitter.configure (C:\Users\George\Source\Repos\ts4\node_modules\feathers\lib\application.js:150:8)
    at EventEmitter.module.exports (C:\Users\George\Source\Repos\ts4\src\authentication.js:12:7)
    at EventEmitter.configure (C:\Users\George\Source\Repos\ts4\node_modules\feathers\lib\application.js:150:8)
    at Object.<anonymous> (C:\Users\George\Source\Repos\ts4\src\app.js:44:5)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
error Command failed with exit code 1.
@daffl
Copy link
Member

daffl commented Sep 13, 2017

Fixed in feathers-cli@2.3.7. The error can be fixed in a generated application by changing src/app.js from

app.configure(jwt(config.jwt));
app.configure(local(config.local));

To

app.configure(jwt());
app.configure(local());

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants