Skip to content

Commit b7445c4

Browse files
committed
Only encrypt client secret if present (fixes #73)
1 parent d1a7421 commit b7445c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

emailproxy.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,9 @@ def get_oauth2_credentials(username, password, recurse_retries=True):
422422
'each time the access token expires (does your `oauth2_scope` value allow `offline` use?)')
423423

424424
if AppConfig.globals().getboolean('encrypt_client_secret_on_first_use', fallback=False):
425-
config.set(username, 'client_secret_encrypted', OAuth2Helper.encrypt(fernet, client_secret))
426-
config.remove_option(username, 'client_secret')
425+
if client_secret:
426+
config.set(username, 'client_secret_encrypted', OAuth2Helper.encrypt(fernet, client_secret))
427+
config.remove_option(username, 'client_secret')
427428

428429
AppConfig.save()
429430

0 commit comments

Comments
 (0)