Loading services/register/register_service/core/register_operations.py +4 −4 Original line number Original line Diff line number Diff line Loading @@ -52,11 +52,11 @@ class RegisterOperations: exist_user = mycol.find_one({"username": username}) exist_user = mycol.find_one({"username": username}) if exist_user is None: if exist_user is None: return jsonify("Not exister user with this credentials"), 400 return jsonify("No user with these credentials"), 400 stored_password = exist_user["password"] stored_password = exist_user["password"] if not bcrypt.checkpw(password.encode('utf-8'), stored_password): if not bcrypt.checkpw(password.encode('utf-8'), stored_password): return jsonify("Not exister user with this credentials"), 400 return jsonify("No user with these credentials"), 400 access_token = create_access_token(identity=(username + " " + exist_user["role"])) access_token = create_access_token(identity=(username + " " + exist_user["role"])) url = f"http://{self.config['ca_factory']['url']}:{self.config['ca_factory']['port']}/v1/secret/data/ca" url = f"http://{self.config['ca_factory']['url']}:{self.config['ca_factory']['port']}/v1/secret/data/ca" Loading @@ -78,11 +78,11 @@ class RegisterOperations: exist_user = mycol.find_one({"username": username}) exist_user = mycol.find_one({"username": username}) if exist_user is None: if exist_user is None: return jsonify("Not exister user with this username"), 400 return jsonify("No user with these credentials"), 400 stored_password = exist_user["password"] stored_password = exist_user["password"] if not bcrypt.checkpw(password.encode('utf-8'), stored_password): if not bcrypt.checkpw(password.encode('utf-8'), stored_password): return jsonify("Not exister user with this password"), 400 return jsonify("No user with these credentials"), 400 mycol.delete_one({"username": username}) mycol.delete_one({"username": username}) return jsonify(message="User removed successfully"), 204 return jsonify(message="User removed successfully"), 204 Loading Loading
services/register/register_service/core/register_operations.py +4 −4 Original line number Original line Diff line number Diff line Loading @@ -52,11 +52,11 @@ class RegisterOperations: exist_user = mycol.find_one({"username": username}) exist_user = mycol.find_one({"username": username}) if exist_user is None: if exist_user is None: return jsonify("Not exister user with this credentials"), 400 return jsonify("No user with these credentials"), 400 stored_password = exist_user["password"] stored_password = exist_user["password"] if not bcrypt.checkpw(password.encode('utf-8'), stored_password): if not bcrypt.checkpw(password.encode('utf-8'), stored_password): return jsonify("Not exister user with this credentials"), 400 return jsonify("No user with these credentials"), 400 access_token = create_access_token(identity=(username + " " + exist_user["role"])) access_token = create_access_token(identity=(username + " " + exist_user["role"])) url = f"http://{self.config['ca_factory']['url']}:{self.config['ca_factory']['port']}/v1/secret/data/ca" url = f"http://{self.config['ca_factory']['url']}:{self.config['ca_factory']['port']}/v1/secret/data/ca" Loading @@ -78,11 +78,11 @@ class RegisterOperations: exist_user = mycol.find_one({"username": username}) exist_user = mycol.find_one({"username": username}) if exist_user is None: if exist_user is None: return jsonify("Not exister user with this username"), 400 return jsonify("No user with these credentials"), 400 stored_password = exist_user["password"] stored_password = exist_user["password"] if not bcrypt.checkpw(password.encode('utf-8'), stored_password): if not bcrypt.checkpw(password.encode('utf-8'), stored_password): return jsonify("Not exister user with this password"), 400 return jsonify("No user with these credentials"), 400 mycol.delete_one({"username": username}) mycol.delete_one({"username": username}) return jsonify(message="User removed successfully"), 204 return jsonify(message="User removed successfully"), 204 Loading