Skip to content
This repository was archived by the owner on Mar 22, 2022. It is now read-only.

Generate new app, Google-only auth, throws error #568

Closed
nabeards opened this issue Sep 13, 2017 · 2 comments
Closed

Generate new app, Google-only auth, throws error #568

nabeards opened this issue Sep 13, 2017 · 2 comments

Comments

@nabeards
Copy link

Steps to reproduce

I generated a new app via the feathers-cli with Google-only authentication:

feathers generate app
? What folder should the source files live in? src
? Which package manager are you using (has to be installed globally)? npm
? What type of API are you making? REST, Realtime via Socket.io

then:

feathers generate authentication
? What authentication providers do you want to use? Other PassportJS strategies not in this list can still be configured manually. Google
? What is the name of the user (entity) service? users
? What kind of service is it? Mongoose
? What is the database connection string? mongodb://localhost:27017/{projectname}

Then I created the {projectname} database.
then:

npm start

> node src/

/{projectfolder}/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 Function.jwtAuth ({projectfolder}/node_modules/feathers-authentication-jwt/lib/index.js:58:13)
    at Function.configure ({projectfolder}/node_modules/feathers/lib/application.js:150:8)
    at Function.module.exports ({projectfolder}/src/authentication.js:13:7)
    at Function.configure ({projectfolder}/node_modules/feathers/lib/application.js:150:8)
    at Object.<anonymous> ({projectfolder}/src/app.js:47:5)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> ({projectfolder}/src/index.js:3:13)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)

Expected behavior

The app should start.

Actual behavior

The app throws the error above.

System configuration

OS X, node 8.4.0, npm 5.3.0

Module versions (especially the part that's not working):
feathers: 2.2.0
feathers-authentication: 1.2.7
feathers-authentication-jwt: 0.3.2

@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

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

To

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

@daffl daffl closed this as completed Sep 13, 2017
@nabeards
Copy link
Author

Awesome, thank you!

# 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