- Documentation
- Server functions
- passwordVerify
Function
passwordVerify
Checks whether a password matches a hash from passwordHash. With a callback the result goes to it.
Syntax
bool passwordVerify(string password, string hash [, table options, function callback])Arguments
passwordstring- The typed password.
hashstring- The stored hash.
optionstable, optional- Unused.
callbackfunction, optionalfunction(matches).
Returns
true if the password matches.
Example
addEvent("login", true)
addEventHandler("login", root, function(password)
local stored = getElementData(client, "hash")
if stored and passwordVerify(password, stored) then
outputChatBox("Zalogowano.", client)
end
end)