Skip to content

Instantly share code, notes, and snippets.

@ivportilla
Last active January 3, 2017 04:19
Show Gist options
  • Save ivportilla/c8fcb0f7e506d50e27f605e008329380 to your computer and use it in GitHub Desktop.
Save ivportilla/c8fcb0f7e506d50e27f605e008329380 to your computer and use it in GitHub Desktop.
Feathers auth error
const auth = require('feathers-authentication');
const FacebookStrategy = require('passport-facebook').Strategy;
const FacebookTokenStrategy = require('passport-facebook-token');
const local = require('feathers-authentication-local');
const jwt = require('feathers-authentication-jwt');
const oauth2 = require('feathers-authentication-oauth2');
module.exports = function() {
const app = this;
const config = app.get('auth');
app.configure(auth(config))
.configure(local())
.configure(jwt())
.configure(oauth2({
name: 'facebook',
Strategy: FacebookStrategy,
tokenStrategy: FacebookTokenStrategy,
}));
app.service('authentication').hooks({
before: {
create: [
auth.hooks.authenticate('local'),
],
}
});
};
{
"host": "localhost",
"port": 3030,
"mongodb": "mongodb://localhost:27017/inspector-dev",
"public": "../public/",
"auth": {
"secret": "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ==",
"facebook": {
"clientID": "XXXXXXXXXXXXX",
"clientSecret": "XXXXXXXXXXXXXXXXXXX",
"scope": ["public_profile","email"]
}
}
}
feathers-authentication-local:verify Checking credentials +2ms [email protected] abc1234
feathers-authentication:passport:authenticate Authentication strategy 'local' failed +20ms undefined undefined
error: (401) Route: /authentication - Error
info: NotAuthenticated: Error
at NotAuthenticated.ExtendableBuiltin (/home/ivcp/Documents/Sapco/mobi-backend/node_modules/feathers-errors/lib/index.js:21:28)
at NotAuthenticated.FeathersError (/home/ivcp/Documents/Sapco/mobi-backend/node_modules/feathers-errors/lib/index.js:96:116)
at new NotAuthenticated (/home/ivcp/Documents/Sapco/mobi-backend/node_modules/feathers-errors/lib/index.js:149:117)
at /home/ivcp/Documents/Sapco/mobi-backend/node_modules/feathers-authentication/lib/hooks/authenticate.js:79:31
at process._tickCallback (internal/process/next_tick.js:103:7)
# After do a POST to /authentication with valid email and password
{
"name": "NotAuthenticated",
"message": "Error",
"code": 401,
"className": "not-authenticated",
"errors": {}
}
"dependencies": {
"body-parser": "^1.15.2",
"compression": "^1.6.2",
"cors": "^2.8.1",
"feathers": "^2.0.3",
"feathers-authentication": "^1.0.2",
"feathers-authentication-jwt": "^0.3.1",
"feathers-authentication-local": "^0.3.2",
"feathers-authentication-oauth2": "^0.2.3",
"feathers-configuration": "^0.4.1",
"feathers-errors": "^2.5.0",
"feathers-hooks": "^1.7.1",
"feathers-mongoose": "^3.6.1",
"feathers-rest": "^1.6.0",
"feathers-socketio": "^1.4.2",
"mongoose": "^4.7.4",
"passport": "^0.3.2",
"passport-facebook": "^2.1.1",
"passport-facebook-token": "^3.3.0",
"passport-google-oauth20": "^1.0.0",
"passport-google-token": "^0.1.2",
"serve-favicon": "^2.3.2",
"winston": "^2.3.0"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment