diff options
author | Eduardo Chappa <chappa@washington.edu> | 2021-12-04 15:18:14 -0700 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2021-12-04 15:18:14 -0700 |
commit | 34645259b43096433f09c640cd2029026149052d (patch) | |
tree | 681f57bb7cd9fb093f01a7907f0b3ed7437249d1 | |
parent | 90d819144d14e3ca375ead5aa2c3b3158248780a (diff) | |
download | alpine-34645259b43096433f09c640cd2029026149052d.tar.xz |
* In addition to the previous commit, make sure to suggest the correct
flow when the flow is configured incorrectly.
-rw-r--r-- | alpine/imap.c | 16 | ||||
-rw-r--r-- | pith/pine.hlp | 2 |
2 files changed, 14 insertions, 4 deletions
diff --git a/alpine/imap.c b/alpine/imap.c index 8fada329..f078f779 100644 --- a/alpine/imap.c +++ b/alpine/imap.c @@ -866,7 +866,7 @@ mm_login_oauth2(NETMBX *mb, char *user, char *method, x = oauth2_get_client_info(oa2list->name, user); if(!x) return; /* user cancelled, let's get out of here */ if(x){ - int error = 0; + int error = 0, authorize = 0, device = 0; if(x->flow){ for(oa2list = alpine_oauth2_list; oa2list && oa2list->host != NULL && oa2list->host[0] != NULL; @@ -877,6 +877,8 @@ mm_login_oauth2(NETMBX *mb, char *user, char *method, if(i < OAUTH2_TOT_EQUIV && oa2list->host[i] != NULL){ char *flow = oa2list->server_mthd[0].name ? "Authorize" : (oa2list->server_mthd[1].name ? "Device" : NULL); + authorize += oa2list->server_mthd[0].name ? 1 : 0; + device += oa2list->server_mthd[1].name ? 1 : 0; if(flow && !strucmp(x->flow, flow)) break; /* found it */ } } @@ -885,8 +887,16 @@ mm_login_oauth2(NETMBX *mb, char *user, char *method, } else error++; if(error){ - if(x->flow) - q_status_message1(SM_ORDER | SM_DING, 3, 3, _("Unrecognized flow type \"%s\". Use \"Authorize\" or \"Device\""), x->flow); + if(x->flow){ + snprintf(tmp_20k_buf, SIZEOF_20KBUF, _("%s does not support or recognize flow type \"%s\". Use %s%s%s"), + mb->orighost, + x->flow, + authorize ? "\"Authorize\"" : "", + authorize ? (device ? " or " : "") : "", + device ? "\"Device\"" : ""); + tmp_20k_buf[SIZEOF_20KBUF-1] = '\0'; + q_status_message(SM_ORDER | SM_DING, 3, 5, tmp_20k_buf); + } else q_status_message(SM_ORDER | SM_DING, 3, 3, _("Configuration does not specify flow type. Use \"Authorize\" or \"Device\"")); } diff --git a/pith/pine.hlp b/pith/pine.hlp index bacd3413..1d67522c 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 630 2021-12-04 13:19:50 +Alpine Commit 631 2021-12-04 15:18:11 ============= h_news ================= <HTML> <HEAD> |