summaryrefslogtreecommitdiffstats
path: root/accounts/__init__.py
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2016-01-24 03:55:49 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2016-02-02 04:22:16 +0100
commit5e7e7fc832d26178a6036ed483fe3cfffe2b22b2 (patch)
treec74302270b7c262d744876f1d2f93bc84c44a2ba /accounts/__init__.py
parent6eb1db6bff15e1611767f5219ee1b4ea558e3d28 (diff)
downloadweb-5e7e7fc832d26178a6036ed483fe3cfffe2b22b2.tar.gz
web-5e7e7fc832d26178a6036ed483fe3cfffe2b22b2.tar.bz2
web-5e7e7fc832d26178a6036ed483fe3cfffe2b22b2.zip
Encrypt the session data by default
Before we just encrypted the password, now we encrypt the whole session information by default.
Diffstat (limited to 'accounts/__init__.py')
-rw-r--r--accounts/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/accounts/__init__.py b/accounts/__init__.py
index afa348b..d8abf32 100644
--- a/accounts/__init__.py
+++ b/accounts/__init__.py
@@ -6,6 +6,7 @@ import os
from flask import Flask, g, session
from utils import *
+from utils.sessions import EncryptedSessionInterface
from views import default, admin
@@ -15,6 +16,7 @@ app.register_blueprint(admin.bp, url_prefix='/admin')
app.config.from_object('accounts.default_settings')
if 'SPLINE_ACCOUNT_WEB_SETTINGS' in os.environ:
app.config.from_envvar('SPLINE_ACCOUNT_WEB_SETTINGS')
+app.session_interface = EncryptedSessionInterface()
app.all_services = account.SERVICES #TODO: take that from our json file or so
app.user_backend = get_backend(app.config['USER_BACKEND'], app)
@@ -38,7 +40,7 @@ def initialize_user():
if 'username' in session and 'password' in session:
username = ensure_utf8(session['username'])
- password = ensure_utf8(decrypt_password(session['password']))
+ password = ensure_utf8(session['password'])
try:
g.user = current_app.user_backend.auth(username, password)
except ldap.INVALID_CREDENTIALS: