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

Any plans for SSR support? #329

Closed
daniel-ac-martin opened this issue Nov 3, 2020 · 4 comments
Closed

Any plans for SSR support? #329

daniel-ac-martin opened this issue Nov 3, 2020 · 4 comments

Comments

@daniel-ac-martin
Copy link

This looks like a really neat, simply library but it would appear not to support SSR.

Are there any plans to change that? Would it be a lot of work to implement?

@simenandre
Copy link
Member

Hello Daniel,

I've done some testing on this before. I don't personally do a lot of SSR development, so I don't know what needs to be added in order to support it. Maybe @ryancole does?

I were able to use the oidc-react in my testing before: https://github.com/cobraz/nextjs-oidc-react

Don't remember how it was, but you can clone that and check it? :)

Btw, if you know, you are more than welcome to point out what needs to be added.

@ryancole
Copy link
Contributor

ryancole commented Nov 11, 2020

@daniel-ac-martin Hmm. I've not used SSR in a few years. SSR mostly depends on browser state, which needs to somehow make it to the server to be rendered. I'm not sure in the case of OAuth that any state exists in that regard? It's all redirects and local storage stuff. But I supposed regarding local storage, the server would be rendering the JS prior to the browser has a chance to load local storage at all. You'd have to use cookies, I suppose - that's what I recall doing in my SSR applications. Local storage is not compatible with SSR, meanwhile cookies are. Cookies are transmitted with the request - local storage is a JS thing which happens after the response.

I don't personally know. I'd be curious to see how it functions.

My guess? It probably won't work as you expect it initially, but it'll just end up redirecting due to failed authentication anyway. If you can use cookies instead of local storage then it should work.

I don't have anything setup to test it quickly, though.

@simenandre
Copy link
Member

I'm going to close this for now. We probably would like to look into this again after #652

@douglasg14b
Copy link

douglasg14b commented Aug 24, 2023

Is this completed, or is such support (or workarounds) are unavailable? I'm not following why it's closed🤔

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

Successfully merging a pull request may close this issue.

4 participants