File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 1- local config_root = vim .fn .expand (' ~/.config' ) .. " /github-copilot/hosts.json"
2- local config_hosts = config_root .. " /hosts.json"
3- local request = require (' plenary.curl' ).request
4- local post = require (' plenary.curl' ).post
5-
61local M = {}
72
83local function find_config_path ()
@@ -18,14 +13,9 @@ local function json_body(response)
1813 return vim .fn .json_decode (response .body )
1914 end
2015end
16+
2117local function oauth_user (token )
22- local response = request ({
23- url = " https://api.github.com/user" ,
24- headers = {
25- Authorization = " Bearer " .. token ,
26- },
27- })
28- return json_body (response )
18+ return vim .fn .json_decode (vim .fn .system (" curl -s --header \" Authorization: Bearer " .. token .. " \" https://api.github.com/user" ))
2919end
3020
3121local function oauth_save (oauth_token )
You can’t perform that action at this time.
0 commit comments