Make registration idempotent, part 2: be idempotent if the client specifies a username.

This commit is contained in:
David Baker 2016-03-16 19:36:57 +00:00
parent 48b2e853a8
commit a7daa5ae13
3 changed files with 42 additions and 6 deletions

View file

@ -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