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

Commit

Permalink
Fix postgresql issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Apr 20, 2020
1 parent 09adecd commit 7453169
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions synapse/handlers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,14 @@ async def check_auth(
if "session" in authdict:
sid = authdict["session"]

# Convert the URI and method to strings.
uri = request.uri.decode("utf-8")
method = request.uri.decode("utf-8")

# If there's no session ID, create a new session.
if not sid:
session_id = await self.store.create_session(
clientdict, request.uri, request.method, description
clientdict, uri, method, description
)

else:
Expand All @@ -316,7 +320,7 @@ async def check_auth(
# comparator based on the URI, method, and body (minus the auth dict)
# and storing it during the initial query. Subsequent queries ensure
# that this comparator has not changed.
comparator = (request.uri, request.method, clientdict)
comparator = (uri, method, clientdict)
if (session["uri"], session["method"], session["clientdict"]) != comparator:
raise SynapseError(
403,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

CREATE TABLE IF NOT EXISTS ui_auth_sessions(
session_id TEXT NOT NULL, -- The session ID passed to the client.
last_used BIGINT UNSIGNED NOT NULL, -- The last time this session was seen.
last_used BIGINT NOT NULL, -- The last time this session was seen.
serverdict TEXT NOT NULL, -- A JSON dictionary of arbitrary data added by Synapse.
clientdict TEXT NOT NULL, -- A JSON dictionary of arbitrary data from the client.
uri TEXT NOT NULL, -- The URI the UI authentication session is using.
Expand Down

0 comments on commit 7453169

Please sign in to comment.