diff --git a/backend/app/core/security.py b/backend/app/core/security.py index 8e0f70f..20b1c95 100644 --- a/backend/app/core/security.py +++ b/backend/app/core/security.py @@ -35,6 +35,8 @@ def create_access_token(*, data: dict, expires_delta: timedelta = None): return encoded_jwt def chacha20Encrypt(plaintext:str, key=config.KINTONE_PSW_CRYPTO_KEY): + if plaintext is None or plaintext == '': + return None nonce = os.urandom(16) algorithm = algorithms.ChaCha20(key, nonce) cipher = Cipher(algorithm, mode=None) diff --git a/backend/app/db/crud.py b/backend/app/db/crud.py index c697446..2101ad9 100644 --- a/backend/app/db/crud.py +++ b/backend/app/db/crud.py @@ -216,9 +216,9 @@ def edit_domain( update_data = domain.dict(exclude_unset=True) for key, value in update_data.items(): - if(key != "id"): - setattr(db_domain, key, value) - + if key != "id" and not (key == "kintonepwd" and (value is None or value == "")): + setattr(db_domain, key, value) + print(str(db_domain)) db.add(db_domain) db.commit() db.refresh(db_domain) diff --git a/frontend/src/pages/TenantDomain.vue b/frontend/src/pages/TenantDomain.vue index 2819085..3b07c72 100644 --- a/frontend/src/pages/TenantDomain.vue +++ b/frontend/src/pages/TenantDomain.vue @@ -1,54 +1,90 @@