Comments (2)
PATCH or PUT /users/:id does not encrypting the password. I think that is a bug.
As workaround I have used the follow middleware in my json server:
//Middleware for encrypt the password
server.use((req, res, next) => {
if (req.url.indexOf('users') != -1 &&
req.method === 'PATCH' || req.method === 'PUT' &&
req.body.password) {
bcrypt
.hash(req.body.password, 10)
.then((hash) => {
req.body.password = hash
next()
})
.catch(next)
}else{
next() // Simply continue with json-server router
return
}
})
from json-server-auth.
Fixed in 2.1.0 with 4382ef1
from json-server-auth.
Related Issues (20)
- Error 400 Bad Request Question HOT 2
- Cannot find module express
- Can't create posts for logged-in users
- Able to get posts that belong to another user HOT 1
- npm installation does not work, looking for non existent path HOT 5
- How to logout? HOT 1
- Is there way to make admin account ?
- How Is This Different From jsonwebtoken? HOT 1
- "Incorrect password" HOT 2
- Create a profile resource or returns the user id on login request HOT 4
- How to integrate with custom server.js file HOT 1
- Permission Error??
- Password Reset ?
- Cli command cannot find module 'express' HOT 7
- Is there a way to register user with field other than email?
- How to get list of items that belongs to logged user ?
- Override login response to render additional properties, like permissions
- Permissions not working
- It's will be better
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-server-auth.