Skip to content

Commit

Permalink
fix: use fallbackData to prepare user data during SSR (#2968)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Cohen committed Aug 23, 2022
1 parent 3b26338 commit 6e60a27
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pages/_app.tsx
Expand Up @@ -125,6 +125,9 @@ const CoreApp: Omit<NextAppComponentType, 'origGetInitialProps'> = ({
<SWRConfig
value={{
fetcher: (url) => axios.get(url).then((res) => res.data),
fallback: {
'/api/v1/auth/me': user,
},
}}
>
<LanguageContext.Provider value={{ locale: currentLocale, setLocale }}>
Expand Down

0 comments on commit 6e60a27

Please sign in to comment.