Commit 2b8edf56 authored by Alex Kakiris's avatar Alex Kakiris
Browse files

refactor user_login to return plain data

parent e01a9fe6
Loading
Loading
Loading
Loading
+3 −5
Changes for capif_backend/backoffice_service/core/operations.py: 3 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -202,13 +202,11 @@ class Operations:
                verify=False
            )
            if response.status_code == 200:
                json_response = response.json()
                access_token = json_response.get("access_token")
                return jsonify({"access_token": access_token}), 200
                return response.json(), 200
            else:
                return jsonify({"error": "Invalid credentials"}), 401
                return {"error": "Invalid credentials"}, 401
        except requests.exceptions.RequestException as e:
            return jsonify({"error": f"Error during user login: {str(e)}"}), 500
            return {"error": f"Error during user login: {str(e)}"}, 500

    def create_user(self, user_data):
        def login3():