diff options
author | Eduardo Chappa <chappa@washington.edu> | 2020-11-01 16:21:25 -0700 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2020-11-01 16:21:25 -0700 |
commit | fc5a3d34bb2dd42de653e2a2ad761d229aba8954 (patch) | |
tree | fa34d2f9b3cbd6a50947da6ecc8683367e6d492c /imap/src/c-client/auth_oa2.c | |
parent | 649572ba29dfab09cb77a5c2f6f5d12e9822792c (diff) | |
download | alpine-fc5a3d34bb2dd42de653e2a2ad761d229aba8954.tar.xz |
* The previous commit does not allow clients to login using xoauth2, so
this commit fixes that.
Diffstat (limited to 'imap/src/c-client/auth_oa2.c')
-rw-r--r-- | imap/src/c-client/auth_oa2.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/imap/src/c-client/auth_oa2.c b/imap/src/c-client/auth_oa2.c index b446b40f..47cd7260 100644 --- a/imap/src/c-client/auth_oa2.c +++ b/imap/src/c-client/auth_oa2.c @@ -134,9 +134,9 @@ long auth_oauth2_client (authchallenge_t challenger,authrespond_t responder, cha /* empty challenge or user requested abort or client does not have info */ if(tryanother || !oauth2.access_token) { - if (!base) (*responder) (stream,base,NIL,0); + if (!base) (*responder) (stream,base,NIL,0); *trial = 0; /* cancel subsequent attempts */ - ret = LONGT; /* will get a BAD response back */ + ret = base ? NIL : LONGT; /* will get a BAD response back */ } else { unsigned long rlen = strlen(OAUTH2_USER) + strlen(user) @@ -164,12 +164,12 @@ long auth_oauth2_client (authchallenge_t challenger,authrespond_t responder, cha } } fs_give ((void **) &response); + if (!ret) + *trial = 65535; /* don't retry if bad protocol */ } } if(oauth2.param[OA2_Id].value) fs_give((void **) &oauth2.param[OA2_Id].value); if(oauth2.param[OA2_Secret].value) fs_give((void **) &oauth2.param[OA2_Secret].value); if(oauth2.param[OA2_Tenant].value) fs_give((void **) &oauth2.param[OA2_Tenant].value); - if (!ret) - *trial = 65535; /* don't retry if bad protocol */ return ret; } |