diff --git a/zou/app/blueprints/auth/resources.py b/zou/app/blueprints/auth/resources.py index 259aa25d1..79117b430 100644 --- a/zou/app/blueprints/auth/resources.py +++ b/zou/app/blueprints/auth/resources.py @@ -231,11 +231,15 @@ def post(self): organisation = persons_service.get_organisation() - response = { - "user": user, - "organisation": organisation, - "login": True, - } + response = jsonify( + { + "user": user, + "organisation": organisation, + "login": True, + "access_token": access_token, + "refresh_token": refresh_token, + } + ) if is_from_browser(request.user_agent): set_access_cookies(response, access_token) @@ -245,8 +249,6 @@ def post(self): events_service.create_login_log( user["id"], ip_address, "script" ) - response["access_token"] = access_token - response["refresh_token"] = refresh_token current_app.logger.info(f"User {email} is logged in.") return response except WrongUserException: