diff options
author | Robin Jarry <robin@jarry.cc> | 2024-06-05 17:49:46 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-07-02 22:00:06 +0200 |
commit | 7a2372773ca870466029cf4137fde71082979a25 (patch) | |
tree | d5b9aad77b7bb6274ff37d66dc2c1f2e0fddfa61 /worker/jmap/state.go | |
parent | 588776f42574567f907c190a5ff089256b21e598 (diff) | |
download | aerc-7a2372773ca870466029cf4137fde71082979a25.tar.gz |
jmap: do not keep invalid sessions in cache
If a session is found in the cache, check that it works by issuing
a GetIdentities request. If that request fails, invalidate the cache and
go through the authentication.
Ensure that the session is valid and explicitly fail if it is not.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'worker/jmap/state.go')
-rw-r--r-- | worker/jmap/state.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/worker/jmap/state.go b/worker/jmap/state.go index 3dbab3fb..b86ec6ce 100644 --- a/worker/jmap/state.go +++ b/worker/jmap/state.go @@ -8,7 +8,7 @@ import ( func (w *JMAPWorker) getMailboxState() (string, error) { var req jmap.Request - req.Invoke(&mailbox.Get{Account: w.accountId, IDs: make([]jmap.ID, 0)}) + req.Invoke(&mailbox.Get{Account: w.AccountId(), IDs: make([]jmap.ID, 0)}) resp, err := w.Do(&req) if err != nil { return "", err |