argon2 experiment
This commit is contained in:
@ -5,7 +5,7 @@ local constants = require("constants")
|
||||
|
||||
local util = require("util")
|
||||
|
||||
local bcrypt = require("bcrypt")
|
||||
local auth = require("lib.auth")
|
||||
local rand = require("openssl.rand")
|
||||
|
||||
local models = require("models")
|
||||
@ -14,7 +14,7 @@ local Sessions = models.Sessions
|
||||
local Avatars = models.Avatars
|
||||
|
||||
local function authenticate_user(user, password)
|
||||
return bcrypt.verify(password, user.password_hash)
|
||||
return auth.verify(password, user.password_hash)
|
||||
end
|
||||
|
||||
local function create_session_key()
|
||||
@ -321,7 +321,7 @@ app:post("user_signup", "/signup", function(self)
|
||||
|
||||
local new_user = Users:create({
|
||||
username = username,
|
||||
password_hash = bcrypt.digest(password, constants.BCRYPT_ROUNDS),
|
||||
password_hash = auth.digest(password),
|
||||
permission = constants.PermissionLevel.GUEST,
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user