oauth-guard/get_user_info.lua
2025-07-03 17:07:35 -07:00

9 lines
221 B
Lua

function get_user_info(token)
local json = require("json")
local resp, status = http.get("https://api.github.com/user", {
Authorization = "Bearer " .. token
})
local data = json.decode(resp)
return data.login
end