fix: Base64 encode password for Dify API login #3
+93
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
問題
difync init実行時に認証エラーが発生していた:背景
2026/1/15 に Dify を 1.11.4 にバージョンアップしたところ、
difync init実行時に認証エラーが発生するようになりました。エラー内容
login API returned error: status=401, body={"code":"authentication_failed","message":"Invalid encrypted data","status":401}
原因
Dify 1.11.4 でログインAPIの仕様が変更され、パスワードをBase64エンコードして送信する必要があるようになりました。
Difyのフロントエンドコードを確認したところ:
web/app/signin/components/mail-and-password-auth.tsxでencryptPassword(password)を呼び出しweb/utils/encryption.tsの実装でパスワードをBase64エンコードして送信修正内容
Login関数でパスワードをBase64エンコードしてからAPIに送信するよう変更
原因調査
encryptPassword(password)を呼び出している修正内容
Login関数でパスワードをBase64エンコードしてからAPIに送信するよう変更
検証
difync initが正常に動作することを確認(153アプリを取得)