diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index b3db4329..1a389b94 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -26,6 +26,7 @@ interface AuthContextType { signInWithOAuth: (provider: "github" | "google") => Promise; signOut: () => Promise; updateProfile: (updates: Partial) => Promise; + refreshProfile: () => Promise; } const AuthContext = createContext(undefined); @@ -259,6 +260,10 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ } }; + const refreshProfile = async () => { + if (user?.id) await fetchUserProfile(user.id); + }; + const value = { user, profile, @@ -271,6 +276,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ signInWithOAuth, signOut, updateProfile, + refreshProfile, }; return {children};