From 1a326c3fc101c76693bc5e3b46e24625839c4b2e Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 14 Sep 2023 19:53:41 +0200 Subject: keep user logged in after password change --- fietsboek/views/user_data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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") -- cgit v1.2.3