so that I can access my personalized dashboard, view my tasks, and manage family-related activities securely.
Description
Acceptance Criteria
There is a Log in button on the top right in the header, and if user isn't signed in, there is a message "You are not logged in!
Please log in." on every page.
Clicking the Log in button shows GitHub login page.
After the user signs in, their avatar and username should appear in the top right corner and the whole user specific content from the homepage is visible.
Clicking the avatar and username navigates user to their profile page.
On the user's profile page, there should be a "Log out" button.
Clicking on "Log out" button signs the user out.
Tasks
[ ] create branch feature/user-login
[ ] register a OAuth-App at Github
[ ] implement basic Setup (npm install next-auth, define Api-route, Provide session context, Set the environment variables)
[ ] configure _app.js to provide session-contex
[ ] create Login and use useSession hook
[ ] build collection for users in MongoDB
[ ] create schema and models for user in /db/models
[ ] create dynamic route pages/api/user/[id] and handle methods: GET and POST
User Login
Value Proposition
As a family member,
I want to be able to log in to the app,
so that I can access my personalized dashboard, view my tasks, and manage family-related activities securely.
Description
Acceptance Criteria
Log in
button on the top right in the header, and if user isn't signed in, there is a message "You are not logged in! Please log in." on every page.Log in
button shows GitHub login page.Tasks
feature/user-login
_app.js
to provide session-contexuseSession hook
pages/api/user/[id]
and handle methods: GET and POST_app.js
to provide session-contextSources
NextAuth Workshop Repo 1 NextAuth Workshop Repo 2