mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 22:27:34 +00:00
add: revoke token & sigle token
This commit is contained in:
parent
805b7d3fef
commit
8e9c4717b6
|
@ -32,11 +32,23 @@ end
|
|||
|
||||
// Generate a unique token that allow player to update data link to this server (ex: screnshot, report bug, etc.)
|
||||
function gmInte.getClientOneTimeToken(ply, callback)
|
||||
gmInte.http.get("/players/" .. ply:SteamID64() .. "/get-one-time-token", function(code, data)
|
||||
gmInte.http.get("/players/" .. ply:SteamID64() .. "/single-token", function(code, data)
|
||||
callback(data.token)
|
||||
end)
|
||||
end
|
||||
|
||||
function gmInte.createClientToken(ply, callback)
|
||||
gmInte.http.get("/players/" .. ply:SteamID64() .. "/tokens", function(code, data)
|
||||
callback(data)
|
||||
end)
|
||||
end
|
||||
|
||||
function gmInte.revokeClientToken(ply, callback)
|
||||
gmInte.http.delete("/players/" .. ply:SteamID64() .. "/tokens", function(code, data)
|
||||
callback(data)
|
||||
end)
|
||||
end
|
||||
|
||||
function gmInte.playerConnect(data)
|
||||
gmInte.http.post("/players/" .. util.SteamIDTo64(data.networkid) .. "/connect", data)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user