core: ensure user is fetched after sign up

This commit is contained in:
Abdullah Atta
2026-02-19 10:42:50 +05:00
parent 09e5d014df
commit 20d9bf1f23

View File

@@ -90,14 +90,15 @@ class UserManager {
);
const user = await this.fetchUser();
if (!user) return;
if (!user) throw new Error("Failed to fetch user after signup.");
await this.db.setLastSynced(0);
await this.db.syncer.devices.register();
await this.db.storage().deriveCryptoKey({
password,
salt: user.salt
});
await this.db.setLastSynced(0);
await this.db.syncer.devices.register();
const masterKey = await this.getMasterKey();
if (!masterKey) throw new Error("User encryption key not generated.");