-
Notifications
You must be signed in to change notification settings - Fork 1
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] fixed auth context + sessionDemo #23
base: main
Are you sure you want to change the base?
Conversation
}) { | ||
const [session, setSession] = useState<Session | null>(null); | ||
|
||
/* useEffect(() => { |
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 you delete the comments?
setMessage('Login successful!'); | ||
setIsError(false); | ||
setTimeout(() => { | ||
router.push('/sessionDemo'); |
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 you push onboarding/general
to the router instead of the sessionDemo?
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.
thanks for the including this file for testing! can you unadd it so that i can merge it to main?
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.
oop yeah
🍞 What's new in this PR
🥐 Description
Implemented auth context that saves login / session state and allows for sign in / sign out functionality. Currently, after login or signup, the new code will route to a dummy sessionDemo page that displays which user is currently logged in and provides a button for current user to log out with. I write to the console logs every time a new session is created which could aid in debugging / validating, but I believe I fixed the error of improperly saving the login state we discussed during worksession.
🥖 Screenshots
🥪 How to review
So the authContextProvider which contains the core functionality of the auth context is located in utils/authContextProvider.tsx
Also made adjustments to app/layout.tsx, app/auth/signin/page.tsx, app/auth/signup/page.tsx, and created a new app/auth/sessionDemo/page.tsx to illustrate that the session management works.
🥧 Next steps
🥞 Relevant links
🥨 Online sources
https://www.youtube.com/watch?v=r7SAlIlMs1k
https://github.com/calblueprint/girls-write-now/pull/17/files
🥯 Related PRs
CC: @celinechoiii @me-liu