mirror of
https://github.com/minetest-mods/irc_commands.git
synced 2025-01-09 23:30:19 +01:00
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
|
if not inChannel then
|
||||||
return false, "You need to be in the server's channel to log in."
|
return false, "You need to be in the server's channel to log in."
|
||||||
end
|
end
|
||||||
local auth = minetest.auth_table[playerName]
|
local handler = minetest.get_auth_handler()
|
||||||
if auth and minetest.get_password_hash(playerName, password) == auth.password then
|
local auth = handler.get_auth(playerName)
|
||||||
|
if auth and minetest.check_password_entry(playerName, auth.password, password) then
|
||||||
minetest.log("action", "User "..user.nick
|
minetest.log("action", "User "..user.nick
|
||||||
.." from IRC logs in as "..playerName)
|
.." from IRC logs in as "..playerName)
|
||||||
irc_users[user.nick] = playerName
|
irc_users[user.nick] = playerName
|
||||||
|
handler.record_login(playerName)
|
||||||
return true, "You are now logged in as "..playerName
|
return true, "You are now logged in as "..playerName
|
||||||
else
|
else
|
||||||
minetest.log("action", user.nick.."@IRC attempted to log in as "
|
minetest.log("action", user.nick.."@IRC attempted to log in as "
|
||||||
|
Loading…
Reference in New Issue
Block a user