summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2018-09-27 07:31:45 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2018-09-27 07:33:47 +0200
commitc4960aaf9346d99722f08eb6c91e9fa34e0adbc7 (patch)
tree16e507078990f7c29145be5126c793c1c71e247f
parentea0a33645a782d8d7531d78c39fe58f116c8d30d (diff)
downloadcalcurse-c4960aaf9346d99722f08eb6c91e9fa34e0adbc7.tar.gz
calcurse-c4960aaf9346d99722f08eb6c91e9fa34e0adbc7.zip
calcurse-caldav: fix auth method check
Fixes a regression introduced in 6a6c711 (calcurse-caldav: fix basic authentication, 2018-07-20). Addresses GitHub issue #149. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rwxr-xr-xcontrib/caldav/calcurse-caldav.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py
index 29ac328..b8d2582 100755
--- a/contrib/caldav/calcurse-caldav.py
+++ b/contrib/caldav/calcurse-caldav.py
@@ -688,12 +688,10 @@ try:
# Authenticate with OAuth2 and authorize HTTP object
cred = run_auth(authcode)
conn = cred.authorize(conn)
-
- # Add credentials to httplib2 to be used when request requires authentication
- if authmethod == 'basic':
+ elif authmethod == 'basic':
+ # Add credentials to httplib2
conn.add_credentials(username, password)
-
- elif authmethod != 'basic':
+ else:
die('Invalid option for AuthMethod in config file. Use "basic" or "oauth2"')
if init: