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/worker.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/worker.go')
-rw-r--r-- | worker/jmap/worker.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/worker/jmap/worker.go b/worker/jmap/worker.go index 0b1c57ae..67553272 100644 --- a/worker/jmap/worker.go +++ b/worker/jmap/worker.go @@ -38,10 +38,9 @@ type JMAPWorker struct { allMail string } - w *types.Worker - client *jmap.Client - cache *cache.JMAPCache - accountId jmap.ID + w *types.Worker + client *jmap.Client + cache *cache.JMAPCache selectedMbox jmap.ID dir2mbox map[string]jmap.ID |