Fixed broken get_current_user not working
Signed-off-by: Robear Selwans <robear.selwans@outlook.com>
This commit is contained in:
@@ -26,13 +26,13 @@ function M.get_current_user(callback)
|
||||
"-s",
|
||||
"--fail",
|
||||
"-X",
|
||||
"POST",
|
||||
config.host .. "/api/v1/auth/status",
|
||||
"GET",
|
||||
config.host .. "/api/v1/auth/me",
|
||||
}, function(job, return_val)
|
||||
if return_val == 0 then
|
||||
local result_string = table.concat(job:result(), "")
|
||||
local data = vim.json.decode(result_string)
|
||||
callback(data or nil)
|
||||
callback(data and data.user or nil)
|
||||
else
|
||||
vim.schedule(function()
|
||||
vim.notify("Failed to get user info.", vim.log.levels.ERROR)
|
||||
|
||||
Reference in New Issue
Block a user