refactor: update user decryption structure in sync response for consistency

This commit is contained in:
shuaiplus
2026-02-10 22:07:34 +08:00
parent f2a857d3f3
commit c445714fd5
2 changed files with 12 additions and 10 deletions
+11 -9
View File
@@ -112,16 +112,18 @@ export async function handleSync(request: Request, env: Env, userId: string): Pr
},
policies: [],
sends: [],
userDecryption: {
masterPasswordUnlock: {
salt: user.email,
kdf: {
kdfType: user.kdfType,
iterations: user.kdfIterations,
memory: user.kdfMemory || null,
parallelism: user.kdfParallelism || null,
UserDecryptionOptions: {
HasMasterPassword: true,
Object: 'userDecryptionOptions',
MasterPasswordUnlock: {
Kdf: {
KdfType: user.kdfType,
Iterations: user.kdfIterations,
Memory: user.kdfMemory || null,
Parallelism: user.kdfParallelism || null,
},
masterKeyEncryptedUserKey: user.key,
MasterKeyEncryptedUserKey: user.key,
Salt: user.email,
},
},
object: 'sync',
+1 -1
View File
@@ -273,6 +273,6 @@ export interface SyncResponse {
domains: any;
policies: any[];
sends: any[];
userDecryption: any | null;
UserDecryptionOptions: UserDecryptionOptions | null;
object: string;
}