WIP 1.51.14: GET /me carries the session fields the app needs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls1vMdg2GYqbnKZmPaX1ot
This commit is contained in:
2026-10-30 08:07:06 +02:00
co-authored by Claude Opus 5.5
parent e95d52ccdd
commit 8747431bd5
8 changed files with 111 additions and 14 deletions
+3 -1
View File
@@ -59,7 +59,9 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
// Validate the stored token by fetching the user profile.
// Only update React state after a successful response so we never
// hold a half-initialised (token set, user null) state.
const me = await (apiV2Data("get", "/me", { authToken: t }) as Promise<AuthUser>);
const { data } = await apiV2("get", "/me", { authToken: t });
// The app's user keeps v1's name for the phone number.
const me = { ...data, phoneNumber: data.phone ?? undefined } as AuthUser;
setToken(t);
setUser(me);
cacheUser(me);