From fafac3b4128a0993b0de1c6e8ca3062bf1ccc14e Mon Sep 17 00:00:00 2001 From: Roald de Vries Date: Thu, 8 Dec 2016 16:59:09 +0100 Subject: Revert "[#801] Merge branch 'signup'" This reverts commit d10f607a4d40587510b0dc31b31fe4750bf4a3a3, reversing changes made to c28abba2f5b1186c671ebef508d40ffaae6d5bc5. --- service/pixelated/resources/session.py | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'service/pixelated/resources/session.py') diff --git a/service/pixelated/resources/session.py b/service/pixelated/resources/session.py index 0e46ad8f..9ade8d29 100644 --- a/service/pixelated/resources/session.py +++ b/service/pixelated/resources/session.py @@ -13,15 +13,11 @@ # # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see . -import hashlib -import os from zope.interface import Interface, Attribute, implements from twisted.python.components import registerAdapter from twisted.web.server import Session -CSRF_TOKEN_LENGTH = 32 - class IPixelatedSession(Interface): user_uuid = Attribute('The uuid of the currently logged in user') @@ -32,7 +28,6 @@ class PixelatedSession(object): def __init__(self, session): self.user_uuid = None - self._csrf_token = None def is_logged_in(self): return self.user_uuid is not None @@ -40,10 +35,5 @@ class PixelatedSession(object): def expire(self): self.user_uuid = None - def get_csrf_token(self): - if self._csrf_token is None: - self._csrf_token = hashlib.sha256(os.urandom(CSRF_TOKEN_LENGTH)).hexdigest() - return self._csrf_token - registerAdapter(PixelatedSession, Session, IPixelatedSession) -- cgit v1.2.3