From 117da921c15428899cc5974dcb235bea071f3057 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Tue, 16 Nov 2021 13:17:59 +0100 Subject: [PATCH] feat(api): EE hotfix --- ee/api/chalicelib/blueprints/bp_core_dynamic.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ee/api/chalicelib/blueprints/bp_core_dynamic.py b/ee/api/chalicelib/blueprints/bp_core_dynamic.py index 886b790a4..15e471d63 100644 --- a/ee/api/chalicelib/blueprints/bp_core_dynamic.py +++ b/ee/api/chalicelib/blueprints/bp_core_dynamic.py @@ -364,7 +364,11 @@ def process_invitation_link(): return {"errors": ["invitation not found"]} if user["expiredInvitation"]: return {"errors": ["expired invitation, please ask your admin to send a new one"]} - pass_token = users.allow_password_change(user_id=user["userId"]) + if user["expiredChange"] is not None and not user["expiredChange"] \ + and user["changePwdToken"] is not None and user["changePwdAge"] < -5 * 60: + pass_token = user["changePwdToken"] + else: + pass_token = users.allow_password_change(user_id=user["userId"]) return Response( status_code=307, body='',