Skip to content

encrypt_client_secret_on_first_use: Encode error with no client_secret #73

@athoms

Description

@athoms

Hi,

when encrypt_client_secret_on_first_use is set to True and one or more account sections have no client_secret entry, this

if AppConfig.globals().getboolean('encrypt_client_secret_on_first_use', fallback=False):
config.set(username, 'client_secret_encrypted', OAuth2Helper.encrypt(fernet, client_secret))

throws AttributeError("'NoneType' object has no attribute 'encode'") after getting the access token.

A simple fix would be:

if client_secret and AppConfig.globals().getboolean('encrypt_client_secret_on_first_use', fallback=False):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions