Jump to content

passwordHash, passwordVerify


Zcraks

Recommended Posts

--                          [register]
local passwordHash = passwordHash(password,"bcrypt",{})
		if (passwordHash) then
		...
--                          [login]
outputDebugString(password) -- true
outputDebugString(passwordHash) -- true
	if (passwordVerify(password, passwordHash)) then
		...
	else
		outputDebugString("Account not found")
	end
--

Why is the password still does not match ?

Link to comment

@Zcraks you can replace passwordVerify function by comparing two hashes, for example:

register:

local hashedPassword = passwordHash("your_password","bcrypt",{})
setAccountData(account, "hash_password", hashedPassword) -- save it

login:

local currentHashedPassword = passwordHash("i_have_recently_typed_it","bcrypt",{})
local originalHashedPassword = getAccountData(account, "hash_password")

if (currentHashedPassword == originalHashedPassword) then
  -- do something
end

I guess something wrong with your variables or case sensetivity in your password

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...