iteration
This commit is contained in:
parent
c918c2da39
commit
c296d2612e
@ -87,11 +87,11 @@ while true do
|
|||||||
if request.username == nil or request.password == nil then
|
if request.username == nil or request.password == nil then
|
||||||
rednet.send(client_id, "invalid request")
|
rednet.send(client_id, "invalid request")
|
||||||
|
|
||||||
else if data.users[request.username] == nil then
|
elseif data.users[request.username] == nil then
|
||||||
rednet.send(client_id, "user not found")
|
rednet.send(client_id, "user not found")
|
||||||
|
|
||||||
log(request.username .. " failed log in attempt")
|
log(request.username .. " failed log in attempt")
|
||||||
else if convert_password(request.password) == data.users[request.username].password then
|
elseif convert_password(request.password) == data.users[request.username].password then
|
||||||
local token = generate_token(request.username)
|
local token = generate_token(request.username)
|
||||||
|
|
||||||
rednet.send(client_id, token)
|
rednet.send(client_id, token)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user