feat(sync): unify Google auth under :Pending auth (#72)
* feat(sync): unify Google auth under :Pending auth Problem: users had to run `:Pending gtasks auth` and `:Pending gcal auth` separately, producing two token files and two browser consents for the same Google account. Solution: introduce `oauth.google_client` with combined tasks + calendar scopes and a single `google_tokens.json`. Remove per-backend `auth`/`setup` from `gcal` and `gtasks`; add top-level `:Pending auth` that prompts with `vim.ui.select` and delegates to the shared client's `setup()` or `auth()` based on credential availability. * docs: update vimdoc for unified Google auth Problem: `doc/pending.txt` still documented per-backend `:Pending gtasks auth` / `:Pending gcal auth` commands and separate token files, which no longer exist after the auth unification. Solution: add `:Pending auth` entry to COMMANDS and a new `*pending-google-auth*` section covering the shared PKCE flow, combined scopes, and `google_tokens.json`. Remove `auth` from gcal/gtasks action tables and update all cross-references to use `:Pending auth`. * ci: format
This commit is contained in:
parent
87d8bf0896
commit
ad59e894c7
7 changed files with 102 additions and 77 deletions
|
|
@ -73,15 +73,14 @@ describe('sync', function()
|
|||
assert.is_true(called)
|
||||
end)
|
||||
|
||||
it('routes auth action', function()
|
||||
it('routes auth command', function()
|
||||
local called = false
|
||||
local gcal = require('pending.sync.gcal')
|
||||
local orig_auth = gcal.auth
|
||||
gcal.auth = function()
|
||||
local orig_auth = pending.auth
|
||||
pending.auth = function()
|
||||
called = true
|
||||
end
|
||||
pending.command('gcal auth')
|
||||
gcal.auth = orig_auth
|
||||
pending.command('auth')
|
||||
pending.auth = orig_auth
|
||||
assert.is_true(called)
|
||||
end)
|
||||
end)
|
||||
|
|
@ -102,11 +101,6 @@ describe('sync', function()
|
|||
assert.are.equal('gcal', gcal.name)
|
||||
end)
|
||||
|
||||
it('has auth function', function()
|
||||
local gcal = require('pending.sync.gcal')
|
||||
assert.are.equal('function', type(gcal.auth))
|
||||
end)
|
||||
|
||||
it('has push function', function()
|
||||
local gcal = require('pending.sync.gcal')
|
||||
assert.are.equal('function', type(gcal.push))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue