pending.nvim/lua/pending/sync
Barrett Ruth 0163941a2b
fix(sync): trigger auth then resume operation when not authenticated (#69)
* fix(sync): trigger auth then resume operation when not authenticated

Problem: `get_access_token()` called `auth()` then immediately tried to
load tokens, but `auth()` is async (TCP server + browser redirect), so
tokens were never present at that point. All sync operations silently
aborted when unauthenticated.

Solution: Remove the inline auth attempt from `get_access_token()` and
add an `on_complete` callback to `auth()` / `_exchange_code()`. Add a
`with_token(callback)` helper in `gtasks.lua` and `gcal.lua` that
triggers auth with the sync operation as the continuation, so
`push`/`pull`/`sync` resume automatically after the OAuth flow
completes.

* ci: format
2026-03-05 13:24:43 -05:00
..
gcal.lua fix(sync): trigger auth then resume operation when not authenticated (#69) 2026-03-05 13:24:43 -05:00
gtasks.lua fix(sync): trigger auth then resume operation when not authenticated (#69) 2026-03-05 13:24:43 -05:00
oauth.lua fix(sync): trigger auth then resume operation when not authenticated (#69) 2026-03-05 13:24:43 -05:00