Jump to content

How to deal with callbacks on passwordVerify


Sorata_Kanda

Recommended Posts

Hey everyone,

as you can read the title, I need a little help with callbacks on

passwordVerify

On the wiki, it says it is recommended to use a callback function in order to avoid freezes. But how can I determine inside of my callback function whether passwordVerify returns the hash or false?

Does it work like this?

local function passwordVerifyCB(var)
  if var then
    outputDebugString("The password has been verified.")
  else
    outputDebugString("The password couldn't be verified.")
  end
end
  
passwordVerify("test", --[[Some random hash]], {}, passwordVerifyCB)

Thanks in advance.

Edited by Sorata_Kanda
Spelling mistake
Link to comment

It says it on the wiki: "Returns true if the password matches the hash. Returns false if the password does not match, or if an unknown hash was passed. If a callback was provided, the aforementioned values are arguments to the callback, and this function will always return true."
So, yes.

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...