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: [], policies: [],
sends: [], sends: [],
userDecryption: { UserDecryptionOptions: {
masterPasswordUnlock: { HasMasterPassword: true,
salt: user.email, Object: 'userDecryptionOptions',
kdf: { MasterPasswordUnlock: {
kdfType: user.kdfType, Kdf: {
iterations: user.kdfIterations, KdfType: user.kdfType,
memory: user.kdfMemory || null, Iterations: user.kdfIterations,
parallelism: user.kdfParallelism || null, Memory: user.kdfMemory || null,
Parallelism: user.kdfParallelism || null,
}, },
masterKeyEncryptedUserKey: user.key, MasterKeyEncryptedUserKey: user.key,
Salt: user.email,
}, },
}, },
object: 'sync', object: 'sync',
+1 -1
View File
@@ -273,6 +273,6 @@ export interface SyncResponse {
domains: any; domains: any;
policies: any[]; policies: any[];
sends: any[]; sends: any[];
userDecryption: any | null; UserDecryptionOptions: UserDecryptionOptions | null;
object: string; object: string;
} }