aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2023-09-14 19:53:41 +0200
committerDaniel Schadt <kingdread@gmx.de>2023-09-14 19:53:41 +0200
commit1a326c3fc101c76693bc5e3b46e24625839c4b2e (patch)
treed7e6624c8e55761f625e670188b2c7479099ccc3
parent8b270902c1444a1faa9efc0866b6c84a510578f2 (diff)
downloadfietsboek-1a326c3fc101c76693bc5e3b46e24625839c4b2e.tar.gz
fietsboek-1a326c3fc101c76693bc5e3b46e24625839c4b2e.tar.bz2
fietsboek-1a326c3fc101c76693bc5e3b46e24625839c4b2e.zip
keep user logged in after password change
-rw-r--r--fietsboek/views/user_data.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/fietsboek/views/user_data.py b/fietsboek/views/user_data.py
index 45c499c..2f6daef 100644
--- a/fietsboek/views/user_data.py
+++ b/fietsboek/views/user_data.py
@@ -4,6 +4,7 @@ import datetime
from pyramid.httpexceptions import HTTPForbidden, HTTPFound, HTTPNotFound
from pyramid.i18n import TranslationString as _
from pyramid.request import Request
+from pyramid.security import remember
from pyramid.view import view_config
from sqlalchemy import select
@@ -62,7 +63,8 @@ def do_change_profile(request):
if identity.name != name:
identity.name = name
request.session.flash(request.localizer.translate(_("flash.personal_data_updated")))
- return HTTPFound(request.route_url("user-data"))
+ headers = remember(request, identity.authenticated_user_id())
+ return HTTPFound(request.route_url("user-data"), headers=headers)
@view_config(route_name="add-friend", permission="user", request_method="POST")