```jsx function MyApp({ Component, pageProps }: Ap...
# off-topic
l
Copy code
jsx
function MyApp({ Component, pageProps }: AppProps) {
  const [session, setSession] = useState(null)

  useEffect(() => {
    setSession(supabase.auth.session())

    supabase.auth.onAuthStateChange((_event, session) => {
      setSession(session)
      console.log(session)
    })
  }, [])

  return (
    <PageWrapper>
      <Component {...pageProps} />
    </PageWrapper>
  )
}
g
This type of question should be in help. There was a recent fix made to deal with losing refresh token on background tabs and as part of the fix the signin event gets called when the tab is opened again even if token does not need refreshing. There is an issue on this you might comment on if it is an issue for you versus just wanting to know why. https://github.com/supabase/gotrue-js/issues/284
l
thanks alot but i have 1 more problem. When I refresh the page onAuthStateChange doesnt even run, that means that I cant stay authenticated when i refresh the page. Any solution?
actually, nevermind lol