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

+5
View File
@@ -17,6 +17,7 @@ import {
getUserById as findStoredUserById,
getUserCount as countStoredUsers,
saveUser as saveStoredUser,
upgradePasswordVerifier as upgradeStoredPasswordVerifier,
} from './storage-user-repo';
import {
type AuditLogListOptions,
@@ -313,6 +314,10 @@ export class StorageService {
await createStoredUser(this.db, this.safeBind.bind(this), user);
}
async upgradePasswordVerifier(userId: string, expectedVerifier: string, securityStamp: string, newVerifier: string): Promise<boolean> {
return upgradeStoredPasswordVerifier(this.db, userId, expectedVerifier, securityStamp, newVerifier);
}
async createFirstUser(user: User): Promise<boolean> {
return createFirstStoredUser(this.db, this.safeBind.bind(this), user);
}