fix: update email display in UI after email change
All checks were successful
CI / ci (push) Successful in 1m11s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 14s

The OIDC session token retains the old email after a Logto email
change. Now the server returns the new email in the response and
the frontend optimistically updates the auth cache.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-12 23:31:24 +02:00
parent 6108db3dab
commit ef531f79b2
2 changed files with 8 additions and 4 deletions

View File

@@ -70,7 +70,7 @@ app.post("/email", zValidator("json", changeEmailSchema), async (c) => {
const logtoSub = await getLogtoSub(db, userId);
await logtoClient.updateEmail(logtoSub, newEmail);
return c.json({ ok: true });
return c.json({ ok: true, email: newEmail });
});
// ── Has Password ────────────────────────────────────────────────────