fix(sync): add backend name prefix to all OAuth log messages (#121)
Problem: four log messages in `oauth.lua` lacked the `self.name` backend prefix, producing generic notifications instead of identifying which backend (`gcal`/`gtasks`) triggered the message. Solution: prepend `self.name .. ': '` to the four unprefixed messages and drop the hardcoded "Google" from the browser prompt since `self.name` already identifies the service.
This commit is contained in:
parent
1eb2e49096
commit
ee6c3f723b
1 changed files with 4 additions and 4 deletions
|
|
@ -447,12 +447,12 @@ function OAuthClient:auth(on_complete)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
vim.ui.open(auth_url)
|
vim.ui.open(auth_url)
|
||||||
log.info('Opening browser for Google authorization...')
|
log.info(self.name .. ': Opening browser for authorization...')
|
||||||
|
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
if not server_closed then
|
if not server_closed then
|
||||||
close_server()
|
close_server()
|
||||||
log.warn('OAuth callback timed out (120s).')
|
log.warn(self.name .. ': OAuth callback timed out (120s).')
|
||||||
end
|
end
|
||||||
end, 120000)
|
end, 120000)
|
||||||
end
|
end
|
||||||
|
|
@ -490,14 +490,14 @@ function OAuthClient:_exchange_code(creds, code, code_verifier, port, on_complet
|
||||||
|
|
||||||
if result.code ~= 0 then
|
if result.code ~= 0 then
|
||||||
self:clear_tokens()
|
self:clear_tokens()
|
||||||
log.error('Token exchange failed.')
|
log.error(self.name .. ': Token exchange failed.')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local ok, decoded = pcall(vim.json.decode, result.stdout or '')
|
local ok, decoded = pcall(vim.json.decode, result.stdout or '')
|
||||||
if not ok or not decoded.access_token then
|
if not ok or not decoded.access_token then
|
||||||
self:clear_tokens()
|
self:clear_tokens()
|
||||||
log.error('Invalid token response.')
|
log.error(self.name .. ': Invalid token response.')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue