-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: add Nextjs SSR example #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, but otherwise looks good to me!
I have 2 more points I wanted to talk about:
1. PKCE
What is the plan for this? I think it might be useful to include PKCE in this example, keen to hear your thoughts on how we planned to roll that out
2. Error-handling
I know we are using an in-memory data store, which makes sense. But currently if you complete the login flow, and then refresh the page, you get this error page:
I'm wondering if it would be more useful if we can render an error page instead with some information on why this is not showing / some other kind of error message.
What do you think?
examples/.DS_Store
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this file and add .DS_Store
to our .gitignore
file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup okay!
examples/nextjs-ssr/src/.DS_Store
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, remove this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@kwajiehao with regards to your 1st point - yes! when you reviewed it the example had yet to be updated with PKCE (that's why it's WIP) - but now I've updated it with PKCE with regards to the 2nd point - the error messages are not showing up because we are using |
This is next.js new features. It does not forward server error to FE through SSR unless we do special error boundary. Let's exclude this for this release because I don't think this is super important. Just some next.js shit features.. |
Saw the changes you made - they look good to me! Don't think we need to do anything more beyond that. Thanks @raynerljm |
bc8af30
to
e2fa907
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Problem
Our SDK currently lacks example apps demonstrating how to use our SDK. This introduces two problems
npm link
)Closes #384
Solution
Added an example Next.js app using SSR and server components (Next.js 13.4 feature). It is hosted here.
Features:
src/lib/store.js
to store Session data (e.g. state, nonce, codeVerifier, etc.)Tests
// TODO: ADD recording