fix: improve authentication reliability and account compatibility

Resolve bugs in internal authentication handling and improve consistency across supported account flows.

Maintain compatibility with existing accounts while preserving user data and established client behavior.

Validation: TypeScript checks, production build, and Worker packaging checks passed.
This commit is contained in:
shuaiplus committed 2026-10-04 15:57:29 +08:00
1 parent 588dce6a0a
commit 5f71cb388c
6 files changed
+144 -71

No files matched your search

+2 -2
View File
@@ -316,7 +316,7 @@ export async function handleRegister(request: Request, env: Env): Promise<Respon
const now = new Date().toISOString();
const auth = new AuthService(env);
const serverHash = await auth.hashPasswordServer(masterPasswordHash, email);
const serverHash = await auth.hashPasswordServer(masterPasswordHash);
const user: User = {
id: generateUUID(),
@@ -764,7 +764,7 @@ export async function handleChangePassword(request: Request, env: Env, userId: s
return errorResponse('masterPasswordHint must be 120 characters or fewer', 400);
}
user.masterPasswordHash = await auth.hashPasswordServer(newMasterPasswordHash, user.email);
user.masterPasswordHash = await auth.hashPasswordServer(newMasterPasswordHash);
user.key = nextKey;
if (nextPrivateKey) user.privateKey = nextPrivateKey;
if (nextPublicKey) user.publicKey = nextPublicKey;