diff options
author | David Baker <dbkr@users.noreply.github.com> | 2016-03-17 14:34:08 +0000 |
---|---|---|
committer | David Baker <dbkr@users.noreply.github.com> | 2016-03-17 14:34:08 +0000 |
commit | 384ee6eafba3f6b76652e2ffb336c66a16aa849d (patch) | |
tree | 48b2efc3a703a21e66f449c37e4aaef36567b9f6 /synapse/handlers/auth.py | |
parent | Merge pull request #651 from matrix-org/markjh/unused_II (diff) | |
parent | remove debug logging (diff) | |
download | synapse-384ee6eafba3f6b76652e2ffb336c66a16aa849d.tar.xz |
Merge pull request #650 from matrix-org/dbkr/register_idempotent_with_username
Make registration idempotent, part 2
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r-- | synapse/handlers/auth.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py index d7233cd0d6..82d458b424 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py @@ -160,6 +160,20 @@ class AuthHandler(BaseHandler): defer.returnValue(True) defer.returnValue(False) + def get_session_id(self, clientdict): + """ + Gets the session ID for a client given the client dictionary + :param clientdict: The dictionary sent by the client in the request + :return: The string session ID the client sent. If the client did not + send a session ID, returns None. + """ + sid = None + if clientdict and 'auth' in clientdict: + authdict = clientdict['auth'] + if 'session' in authdict: + sid = authdict['session'] + return sid + def set_session_data(self, session_id, key, value): """ Store a key-value pair into the sessions data associated with this |