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

[feat] fixed auth context + sessionDemo #23

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

RohinJ444
Copy link
Contributor

🍞 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

  • Need to adjust routing from dummy sessionDemo page to desired next page, and integrate authContext into all pages

🥞 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

}) {
const [session, setSession] = useState<Session | null>(null);

/* useEffect(() => {
Copy link
Collaborator

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');
Copy link
Collaborator

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?

Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oop yeah

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 this pull request may close these issues.

3 participants