Archived
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user