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>
This commit is contained in:
Lukas Fleischer 2018-09-27 07:31:45 +02:00
parent ea0a33645a
commit c4960aaf93

View File

@ -688,12 +688,10 @@ try:
# Authenticate with OAuth2 and authorize HTTP object # Authenticate with OAuth2 and authorize HTTP object
cred = run_auth(authcode) cred = run_auth(authcode)
conn = cred.authorize(conn) conn = cred.authorize(conn)
elif authmethod == 'basic':
# Add credentials to httplib2 to be used when request requires authentication # Add credentials to httplib2
if authmethod == 'basic':
conn.add_credentials(username, password) conn.add_credentials(username, password)
else:
elif authmethod != 'basic':
die('Invalid option for AuthMethod in config file. Use "basic" or "oauth2"') die('Invalid option for AuthMethod in config file. Use "basic" or "oauth2"')
if init: if init: