-
Notifications
You must be signed in to change notification settings - Fork 117
Error while using /auth/local #233
Comments
However i noted that if I register users in two different sessions (stopping server and starting again), I am able to login from both using /auth/local. |
In general Feathers services are stateless so there isn't really any sessions. I did notice some strangeness in https://github.com/rohitketkar87/useradministration-feathers/blob/master/services/userservice.js however. For example I'm not sure if app.post('/api/registeruser', function(req, res, next) {
console.log('mainCtrl : registerUser starts');
var userInput = req.body;
req.app.service('users').create(userInput).then(function(user) {
res.json(user);
}).catch(next);
}); |
@daffl true, right now its not necessary but actually when code grows, it helps to maintain modular structure. Moreover I was just trying out how to fit feathers in my template. |
@daffl Resolved the issue. Thanks. Registered all the hooks at one place. Latest code uploaded to repo. |
I am getting strange error...
I registered two users using my "/users" service in same session.
I was able to login with first user using his username and password.
However when I tried to login with second user, it threw following error.
NotAuthenticated: Invalid login. at Object.construct (D:\POCs\feathers_tutorials\my_feather-app\node_modules\core-js\modules\es6.reflect.construct.js:23:24) at NotAuthenticated.ExtendableBuiltin (D:\POCs\feathers_tutorials\my_feather-app\node_modules\feathers-errors\lib\index.js:21:28) at NotAuthenticated.FeathersError (D:\POCs\feathers_tutorials\my_feather-app\node_modules\feathers-errors\lib\index.js:99:87) at new NotAuthenticated (D:\POCs\feathers_tutorials\my_feather-app\node_modules\feathers-errors\lib\index.js:152:85) at D:\POCs\feathers_tutorials\my_feather-app\node_modules\feathers-authentication\lib\services\local.js:144:27 at allFailed (D:\POCs\feathers_tutorials\my_feather-app\node_modules\passport\lib\middleware\authenticate.js:94:18) at attempt (D:\POCs\feathers_tutorials\my_feather-app\node_modules\passport\lib\middleware\authenticate.js:167:28) at Strategy.strategy.fail (D:\POCs\feathers_tutorials\my_feather-app\node_modules\passport\lib\middleware\authenticate.js:284:9) at verified (D:\POCs\feathers_tutorials\my_feather-app\node_modules\passport-local\lib\strategy.js:82:30) at D:\POCs\feathers_tutorials\my_feather-app\node_modules\feathers-authentication\lib\services\local.js:120:18 at D:\POCs\feathers_tutorials\my_feather-app\node_modules\bcryptjs\dist\bcrypt.js:261:17 at D:\POCs\feathers_tutorials\my_feather-app\node_modules\bcryptjs\dist\bcrypt.js:1198:21 at Immediate.next [as _onImmediate] (D:\POCs\feathers_tutorials\my_feather-app\node_modules\bcryptjs\dist\bcrypt.js:1078:21) at processImmediate [as _immediateCallback] (timers.js:383:17)
Here is my code:
https://github.com/rohitketkar87/useradministration-feathers.git
The text was updated successfully, but these errors were encountered: