Hey
I have implemented Auth0 like this.
This setup works on Chrome but on Safari/Firefox it constantly logs me out.
Any of you have seen it before?
(here’s my Next.js code snippet)
export default function App({ Component, pageProps, auth }) {
if (typeof window === 'undefined') {
return <></>
}
return (
<Auth0Provider
domain={auth.domain}
clientId={auth.clientId}
redirectUri={window.location.origin}
audience={auth.audience}
scope="read:current_user"
>
<Component {...pageProps} />
</Auth0Provider>
)
}
App.getInitialProps = async () => {
const clientId = process.env.AUTH0_CLIENT_ID
const domain = process.env.AUTH0_DOMAIN
const audience = `https://${domain}/api/v2/`
return {
auth: {
clientId,
domain,
audience,
},
}
}