Skip to content

Commit

Permalink
fix: #888 fix auth function when read application admins (#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
MCatherine1994 authored Dec 11, 2023
1 parent cc8460b commit efbba1c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions server/auth_function/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,15 @@ def handle_event(db_connection, event) -> event_type.Event:
FROM app_fam.fam_application_admin app_admin
INNER JOIN app_fam.fam_application application ON
app_admin.application_id = application.application_id
JOIN app_fam.fam_application_client client ON
app_admin.application_id = client.application_id
JOIN app_fam.fam_user fam_user ON
app_admin.user_id = fam_user.user_id
WHERE
fam_user.user_guid = {user_guid}
AND fam_user.user_type_code = {user_type_code}
AND client.cognito_client_id = {cognito_client_id};
AND fam_user.user_type_code = {user_type_code};
"""
sql_query_fam_app_admin = sql.SQL(query_fam_app_admin).format(
user_guid=sql.Literal(user_guid),
user_type_code=sql.Literal(user_type_code),
cognito_client_id=sql.Literal(cognito_client_id),
user_type_code=sql.Literal(user_type_code)
)
cursor.execute(sql_query_fam_app_admin)
for record in cursor:
Expand Down

0 comments on commit efbba1c

Please sign in to comment.