I created authentication for my node project with feathers. I want to do admin's panel based on mongodb. I added new insert to mongo with email and password and for example I added in index file something like this:
app.authenticate({
strategy: 'jwt',
'email': "myemail",
'password': "mypassword"
}).then(function(result){
console.log('Authenticated!', result);
}).catch(function(error){
console.error('Error authenticating!', error);
});
Every time I get this message:
Error authenticating! Object { type: "FeathersError", name: "NotAuthenticated", message: "No auth token", code: 401, className: "not-authenticated", data: Object, errors: Object, stack: "NotAuthenticated: No auth token …" }
My schema and model is correct. For verify provided is an email and password.
How to use feathers authentication properly? What an address should I use to send login (email) and password for login script and how to verify if user is logged?
In short words, I would like to use login form in combination with mongodb. After successfull login the user gets a token JWT. Next request is send as token JWT.