diff options
| author | Bobby <[email protected]> | 2024-08-24 21:35:57 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2024-08-24 21:35:57 -0400 |
| commit | 690dcc05e88c9ad063712969de99ffe462b7a1cd (patch) | |
| tree | 1ef880bb4def644ac178222ed8b8d1f8aa988e38 /authentication/utils.py | |
| parent | 334866905bf2239c4bf756477ddaf84d64b27b28 (diff) | |
| download | yugen-690dcc05e88c9ad063712969de99ffe462b7a1cd.tar.xz yugen-690dcc05e88c9ad063712969de99ffe462b7a1cd.zip | |
Auth middleware
Diffstat (limited to 'authentication/utils.py')
| -rw-r--r-- | authentication/utils.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/authentication/utils.py b/authentication/utils.py index f76c236..3629458 100644 --- a/authentication/utils.py +++ b/authentication/utils.py @@ -49,10 +49,11 @@ def get_discord_user(access_token, token_type): authorized_guilds = os.environ.get("DISCORD_AUTHORIZED_GUILDS").split(",") user["is_authorized"] = False - for guild in guilds: - if guild["id"] in authorized_guilds: - user["is_authorized"] = True - break + if isinstance(guilds, list): + for guild in guilds: + if guild["id"] in authorized_guilds: + user["is_authorized"] = True + break return user |
