Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next.js/SSR compatability #340

Closed
gustavlrsn opened this issue Nov 11, 2020 · 1 comment
Closed

Next.js/SSR compatability #340

gustavlrsn opened this issue Nov 11, 2020 · 1 comment

Comments

@gustavlrsn
Copy link

gustavlrsn commented Nov 11, 2020

Hi!

I'm implementing OIDC in a next.js project, but since this library uses window.location, I'm getting a window is not defined error on the initial server-side render.

I'm thinking adding something like

if (typeof window === 'undefined') return children;

in AuthProvider, and do nothing auth wise on the server-side render, and just let that happen in the subsequent client side render instead. Do you see any downsides with this, or a better solution, maybe something that would actually make it work server-side?

@simenandre
Copy link
Member

Closing this in favor of #329

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants