Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
2 participants
@nabeards
Copy link

nabeards commented Sep 13, 2017

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

This comment has been minimized.

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 Sep 13, 2017

@nabeards

This comment has been minimized.

Copy link
Author

nabeards commented Sep 13, 2017

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.