arreglado error de joi🤮
This commit is contained in:
@@ -19,7 +19,6 @@ const register: RequestHandler = async (req, res, next) => {
|
||||
}
|
||||
|
||||
const { username, password } = req.body
|
||||
|
||||
// Verify account username as unique
|
||||
const found = await Account.findOne({ username })
|
||||
|
||||
@@ -31,7 +30,7 @@ const register: RequestHandler = async (req, res, next) => {
|
||||
}
|
||||
|
||||
// Encrypt password
|
||||
const hash = crypt.hash(password)
|
||||
const hash = await crypt.hash(password)
|
||||
|
||||
// Create account
|
||||
const account = new Account({ username, password: hash })
|
||||
|
||||
Reference in New Issue
Block a user