aboutsummaryrefslogtreecommitdiffstats
path: root/backend/authentication
diff options
context:
space:
mode:
Diffstat (limited to 'backend/authentication')
-rw-r--r--backend/authentication/backend.py2
-rw-r--r--backend/authentication/user.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/backend/authentication/backend.py b/backend/authentication/backend.py
index c84ba10..e150580 100644
--- a/backend/authentication/backend.py
+++ b/backend/authentication/backend.py
@@ -68,6 +68,6 @@ class JWTAuthenticationBackend(authentication.AuthenticationBackend):
if await user.fetch_admin_status(request.state.db):
scopes.append("admin")
- scopes.extend(await user.get_user_roles(request.state.db))
+ scopes.extend(await user.get_user_roles())
return authentication.AuthCredentials(scopes), user
diff --git a/backend/authentication/user.py b/backend/authentication/user.py
index ad59103..5e99546 100644
--- a/backend/authentication/user.py
+++ b/backend/authentication/user.py
@@ -44,12 +44,12 @@ class User(BaseUser):
def decoded_token(self) -> dict[str, any]:
return jwt.decode(self.token, SECRET_KEY, algorithms=["HS256"])
- async def get_user_roles(self, database: Database) -> list[str]:
+ async def get_user_roles(self) -> list[str]:
"""Get a list of the user's discord roles."""
if not self.member:
return []
- server_roles = await discord.get_roles(database)
+ server_roles = await discord.get_roles()
roles = [role.name for role in server_roles if role.id in self.member.roles]
if "admin" in roles: