mirror of
https://github.com/minetest/minetest.git
synced 2024-12-24 07:02:23 +01:00
Fix admin password handling in minetest.builtin_auth_handler.get_auth
This commit is contained in:
parent
4cee9a86ac
commit
b494324ec3
@ -1222,13 +1222,20 @@ minetest.builtin_auth_handler = {
|
|||||||
if not minetest.auth_table[name] then
|
if not minetest.auth_table[name] then
|
||||||
minetest.builtin_auth_handler.create_auth(name, minetest.get_password_hash(name, minetest.setting_get("default_password")))
|
minetest.builtin_auth_handler.create_auth(name, minetest.get_password_hash(name, minetest.setting_get("default_password")))
|
||||||
end
|
end
|
||||||
if minetest.is_singleplayer() or name == minetest.setting_get("name") then
|
if minetest.is_singleplayer() then
|
||||||
return {
|
return {
|
||||||
password = "",
|
password = "",
|
||||||
privileges = minetest.registered_privileges
|
privileges = minetest.registered_privileges
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return minetest.auth_table[name]
|
if minetest.auth_table[name] and name == minetest.setting_get("name") then
|
||||||
|
return {
|
||||||
|
password = minetest.auth_table[name].password,
|
||||||
|
privileges = minetest.registered_privileges
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return minetest.auth_table[name]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
create_auth = function(name, password)
|
create_auth = function(name, password)
|
||||||
|
Loading…
Reference in New Issue
Block a user