forked from minetest-mods/irc_commands
Update authentication API usage
This commit is contained in:
parent
7161160667
commit
99afcc794b
6
init.lua
6
init.lua
|
@ -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 "
|
||||
|
|
Loading…
Reference in New Issue
Block a user