summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2022-04-15 17:11:39 -0600
committerEduardo Chappa <chappa@washington.edu>2022-04-15 17:11:39 -0600
commit5aeedb66cbeaa624be27821201ae3ebba56f39e1 (patch)
treecc7c5d3dfde9b2980a6d7c27b8059ee96a614800
parent59e384997c4a7775cce215f1275c526351f58fb0 (diff)
downloadalpine-5aeedb66cbeaa624be27821201ae3ebba56f39e1.tar.xz
* Treat HTTP_BAD code as an error when trying to authenticate using XOAUTH2
and cancel the refresh token (which will restart the authorization process) for the email account.
-rw-r--r--imap/src/c-client/oauth2_aux.c27
-rw-r--r--pith/pine.hlp2
2 files changed, 14 insertions, 15 deletions
diff --git a/imap/src/c-client/oauth2_aux.c b/imap/src/c-client/oauth2_aux.c
index 3bb4b502..b396ccda 100644
--- a/imap/src/c-client/oauth2_aux.c
+++ b/imap/src/c-client/oauth2_aux.c
@@ -397,20 +397,19 @@ mm_login_oauth2_c_client_method (NETMBX *mb, char *user, char *method,
break;
- case HTTP_BAD : break;
-
- default : { char tmp[200];
- char *err, *err_desc;
- jx = json_body_value(json, "error");
- err = cpystr(jx && jx->jtype == JString ? (char *) jx->value : "Unknown error");
- jx = json_body_value(json, "error_description");
- err_desc = cpystr(jx && jx->jtype == JString ? (char *) jx->value : "No description");
- sprintf(tmp, "Code %d: %.80s: %.80s", status, err, err_desc);
- mm_log (tmp, ERROR);
- if(err) fs_give((void **) &err);
- if(err_desc) fs_give((void **) &err_desc);
- oauth2->cancel_refresh_token++;
- }
+ case HTTP_BAD :
+ default : { char tmp[200];
+ char *err, *err_desc;
+ jx = json_body_value(json, "error");
+ err = cpystr(jx && jx->jtype == JString ? (char *) jx->value : "Unknown error");
+ jx = json_body_value(json, "error_description");
+ err_desc = cpystr(jx && jx->jtype == JString ? (char *) jx->value : "No description");
+ sprintf(tmp, "Code %d: %.80s: %.80s", status, err, err_desc);
+ mm_log (tmp, ERROR);
+ if(err) fs_give((void **) &err);
+ if(err_desc) fs_give((void **) &err_desc);
+ oauth2->cancel_refresh_token++;
+ }
}
json_free(&json);
diff --git a/pith/pine.hlp b/pith/pine.hlp
index c5a7d799..06494c39 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 641 2022-04-05 20:43:24
+Alpine Commit 643 2022-04-15 17:11:36
============= h_news =================
<HTML>
<HEAD>