Closed iva2k closed 6 years ago
The authentication packages need the respective types packages e.g. @types/feathersjs__authentication-oauth2
Upon generating authentication with all options selected, the package.json contains
"dependencies": {
"@feathersjs/authentication": "^2.1.7",
"@feathersjs/authentication-jwt": "^2.0.1",
"@feathersjs/authentication-local": "^1.2.1",
"@feathersjs/authentication-oauth2": "^1.1.0",
"@feathersjs/configuration": "^1.0.2",
"@feathersjs/errors": "^3.3.0",
"@feathersjs/express": "^1.2.3",
"@feathersjs/feathers": "^3.1.7",
"@feathersjs/socketio": "^3.2.2",
"ajv": "^6.5.2",
"compression": "^1.7.3",
"cors": "^2.8.4",
"feathers-hooks-common": "^4.14.3",
"feathers-nedb": "^3.1.0",
"helmet": "^3.12.1",
"lodash.merge": "^4.6.1",
"nedb": "^1.8.0",
"passport-auth0": "^1.0.0",
"passport-facebook": "^2.1.1",
"passport-github": "^1.1.0",
"passport-google-oauth20": "^1.0.0",
"serve-favicon": "^2.5.0",
"winston": "^3.0.0"
},
"devDependencies": {
"@types/feathersjs__authentication": "^2.1.1",
"@types/feathersjs__authentication-jwt": "^1.0.3",
"@types/feathersjs__authentication-local": "^1.0.2",
"@types/feathersjs__authentication-oauth2": "^1.0.3",
"@types/nedb": "^1.8.5",
"@types/passport-facebook": "^2.1.8",
"@types/passport-github": "^1.1.3",
"eslint": "^5.1.0",
"mocha": "^5.2.0",
"request": "^2.87.0",
"request-promise": "^4.2.2"
}
So the types packages seem to be included.
@eddyystop You say "all options selected"... I selected all authentication options except auth0 and github, and then I get "@feathersjs/authentication-oauth2": "^1.1.0" in dependencies, but no corresponding devDependencies for types.
I guess there's a missing dependency on types for google and facebook options.
Here's the tail of the log (note there is no @types/feathersjs__authentication-oauth2 anywhere):
...
We are adding the first connection in dir api
? What is the database connection string? nedb://../data
force config\default.json
create src\authentication.ts
force src\app.ts
create test\services\users.test.ts
create src\models\users.model.ts
create src\services\users\users.service.ts
create src\services\users\users.interface.ts
create src\services\users\users.schema.ts
create src\services\users\users.mongo.ts
create src\services\users\users.mongoose.ts
create src\services\users\users.sequelize.ts
create src\services\users\users.validate.ts
create src\services\users\users.hooks.ts
force src\services\index.ts
force src\app.interface.ts
force src\typings.d.ts
npm WARN api@0.0.0 No repository field.
npm WARN api@0.0.0 No license field.
+ @feathersjs/authentication-jwt@2.0.1
+ @feathersjs/authentication@2.1.6
+ @feathersjs/authentication-local@1.2.1
+ passport-facebook@2.1.1
+ @feathersjs/authentication-oauth2@1.1.0
+ @feathersjs/authentication-oauth2@1.1.0
+ passport-google-oauth20@1.0.0
added 34 packages from 27 contributors and audited 868 packages in 4.764s
found 0 vulnerabilities
npm WARN api@0.0.0 No repository field.
npm WARN api@0.0.0 No license field.
+ @types/feathersjs__authentication-local@1.0.2
+ @types/feathersjs__authentication@2.1.1
+ @types/feathersjs__authentication-jwt@1.0.3
+ @types/passport-facebook@2.1.8
added 5 packages from 9 contributors and audited 933 packages in 4.242s
found 0 vulnerabilities
npm WARN api@0.0.0 No repository field.
npm WARN api@0.0.0 No license field.
+ @feathersjs/authentication-local@1.2.1
+ ajv@6.5.2
+ passport-google-oauth20@1.0.0
+ passport-facebook@2.1.1
+ @feathersjs/authentication-oauth2@1.1.0
+ @feathersjs/authentication-oauth2@1.1.0
+ feathers-nedb@3.0.1
added 9 packages from 7 contributors, updated 7 packages and audited 946 packages in 4.779s
found 0 vulnerabilities
npm WARN api@0.0.0 No repository field.
npm WARN api@0.0.0 No license field.
+ @types/nedb@1.8.5
added 1 package from 2 contributors and audited 947 packages in 4.157s
found 0 vulnerabilities
npm WARN api@0.0.0 No repository field.
npm WARN api@0.0.0 No license field.
+ nedb@1.8.0
added 7 packages from 9 contributors and audited 957 packages in 4.738s
found 0 vulnerabilities
Here's the resulting package.json:
{
"name": "api",
"description": "Project api",
"version": "0.0.0",
"homepage": "",
"main": "src",
"keywords": [
"feathers"
],
"author": {
"name": "iva2k",
"email": "iva2k@yahoo.com"
},
"contributors": [],
"bugs": {},
"directories": {
"lib": "src",
"test": "test/"
},
"engines": {
"node": "^8.0.0",
"npm": ">= 3.0.0"
},
"scripts": {
"test": "npm run tslint && npm run mocha",
"tslint": "tslint -p tsconfig.json -c tslint.json && tslint -p tsconfig.test.json -c tslint.json",
"start": "ts-node --files src/",
"mocha": "ts-mocha -p tsconfig.test.json 'test/**/*.test.ts' --timeout 10000 --exit",
"compile": "tsc -p tsconfig.json"
},
"dependencies": {
"@feathersjs/authentication": "^2.1.6",
"@feathersjs/authentication-jwt": "^2.0.1",
"@feathersjs/authentication-local": "^1.2.1",
"@feathersjs/authentication-oauth2": "^1.1.0",
"@feathersjs/configuration": "^1.0.2",
"@feathersjs/errors": "^3.3.0",
"@feathersjs/express": "^1.2.3",
"@feathersjs/feathers": "^3.1.7",
"@feathersjs/socketio": "^3.2.2",
"ajv": "^6.5.2",
"compression": "^1.7.2",
"cors": "^2.8.4",
"feathers-hooks-common": "^4.14.3",
"feathers-nedb": "^3.0.1",
"helmet": "^3.12.1",
"lodash.merge": "^4.6.1",
"nedb": "^1.8.0",
"passport-facebook": "^2.1.1",
"passport-google-oauth20": "^1.0.0",
"serve-favicon": "^2.5.0",
"winston": "^3.0.0"
},
"devDependencies": {
"@types/compression": "0.0.36",
"@types/cors": "^2.8.4",
"@types/feathersjs__authentication": "^2.1.1",
"@types/feathersjs__authentication-jwt": "^1.0.3",
"@types/feathersjs__authentication-local": "^1.0.2",
"@types/feathersjs__configuration": "^1.0.1",
"@types/feathersjs__errors": "^3.2.1",
"@types/feathersjs__express": "^1.1.4",
"@types/feathersjs__feathers": "^3.0.4",
"@types/feathersjs__socketio": "^3.0.3",
"@types/helmet": "0.0.38",
"@types/lodash.merge": "^4.6.3",
"@types/mocha": "^5.2.3",
"@types/nedb": "^1.8.5",
"@types/passport-facebook": "^2.1.8",
"@types/request-promise": "^4.1.41",
"@types/serve-favicon": "^2.2.30",
"@types/winston": "^2.3.9",
"mocha": "^5.2.0",
"request": "^2.87.0",
"request-promise": "^4.2.2",
"ts-mocha": "^1.2.0",
"ts-node": "^7.0.0",
"tslint": "^5.10.0",
"typescript": "^2.9.2"
}
}
If I rerun feathers-plus generate authentication
and select Auth0, then, @types/feathersjs__authentication-oauth2 are installed.
The issue seems to have been that the auth0 typing was not included for the Google strategy.
Fix published as f+/cli v0.4.16.
Please confirm it fixes the situation. Thanks.
Yes, fixed for Google auth.
However, if I select only Facebook, the same typings error remains.
Fix published to f+/cli as v0.4.18 running generator v0.2.24.
Please confirm it fixes the situation. Thanks.
@iva2k any news?
I was out for few days. Just tested Facebook, npm start works fine.
Steps to reproduce
Edit src/services/users/users.schema.?s file, add fields to
required:
andproperties:
Run re-generator:
Expected behavior
Should have running server.
Actual behavior
Fails compiling:
Workaround