aboutsummaryrefslogtreecommitdiffstats
path: root/lib/templates
diff options
context:
space:
mode:
authorDean <gao.dean@hotmail.com>2023-01-11 09:37:48 +1100
committerRobin Jarry <robin@jarry.cc>2023-01-26 00:20:36 +0100
commit38d63cb7f78835e4f99573f09bea6d5441a15af3 (patch)
tree3494219f1466f8d5a802f551d61ef9543128cb2f /lib/templates
parent5dd7ea5d5979808484e0f5ab8f1d7aaf9f65f2f2 (diff)
downloadaerc-38d63cb7f78835e4f99573f09bea6d5441a15af3.tar.gz
imap,smtp: cache and cycle XOAUTH2 refresh token
Normally for emails with xoauth2, the help page says to pass the refresh token as the password. When the refresh token expires, aerc can't fetch the access token, and you must get a new refresh token from the external script. This patch implements a cycle of refresh tokens so you only need to use an external script to fetch the refresh token once. Once you have fetched the initial refresh token (with an external script like mutt_xoauth2.py or https://github.com/gaoDean/oauthRefreshToken), that refresh token is inputted as the password to aerc (as normal) to fetch the access token. Before this patch aerc used to only fetch the access token, but now it fetches that and a new refresh token, which it caches in $XDG_CONFIG_HOME/aerc/<account>-xoauth2.token. In the next opening of aerc, aerc will pull the refresh token from the cache, and use it instead of the inputted refresh token from the password. If it is not present in the cache, the refresh token is taken from the password as usual. Signed-off-by: Dean <gao.dean@hotmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/templates')
0 files changed, 0 insertions, 0 deletions