Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Ensure that UI auth stages are idempotent.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Apr 17, 2020
1 parent bb311c0 commit 4cfc49c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions synapse/storage/data_stores/main/ui_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,10 @@ async def mark_stage_complete(
stage_type: The completed stage type.
identity: The identity authenticated by the stage.
"""
await self.db.simple_insert(
await self.db.simple_upsert(
table="ui_auth_sessions_credentials",
values={
"session_id": session_id,
"stage_type": stage_type,
"identity": json.dumps(identity),
},
keyvalues={"session_id": session_id, "stage_type": stage_type},
values={"identity": json.dumps(identity)},
desc="mark_stage_complete",
)

Expand Down

0 comments on commit 4cfc49c

Please sign in to comment.