Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ic3w0lf22 committed Sep 1, 2021
1 parent 141480a commit 13f90e5
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions RAMAccount.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ local function GET(Method, Account, ...)
Url = Url .. '&Password=' .. WebserverSettings.Password
end

return syn.request {
local Response = syn.request {
Method = 'GET',
Url = Url
}.Body
}

if Response.StatusCode ~= 200 then return false end

return Response.Body
end

local function POST(Method, Account, Body, ...)
Expand All @@ -37,19 +41,23 @@ local function POST(Method, Account, Body, ...)
Url = Url .. '&Password=' .. WebserverSettings.Password
end

return syn.request {
local Response = syn.request {
Method = 'POST',
Url = Url,
Body = Body
}.Body
}

if Response.StatusCode ~= 200 then return false end

return Response.Body
end

function Account.new(Username)
local self = {} setmetatable(self, Account)

local IsValid = GET('Test', Username)

if IsValid.StatusCode ~= 200 or IsValid.Body == 'Invalid Account' then return false end
if not IsValid or IsValid == 'Invalid Account' then return false end

self.Username = Username

Expand Down

0 comments on commit 13f90e5

Please sign in to comment.