Update authentication API usage

This commit is contained in:
ShadowNinja 2016-06-01 12:17:21 -04:00
parent 7161160667
commit 99afcc794b

View File

@ -58,11 +58,13 @@ irc:register_bot_command("login", {
if not inChannel then
return false, "You need to be in the server's channel to log in."
end
local auth = minetest.auth_table[playerName]
if auth and minetest.get_password_hash(playerName, password) == auth.password then
local handler = minetest.get_auth_handler()
local auth = handler.get_auth(playerName)
if auth and minetest.check_password_entry(playerName, auth.password, password) then
minetest.log("action", "User "..user.nick
.." from IRC logs in as "..playerName)
irc_users[user.nick] = playerName
handler.record_login(playerName)
return true, "You are now logged in as "..playerName
else
minetest.log("action", user.nick.."@IRC attempted to log in as "