Implement GitHub Authentication necessary changes (Server has the OAuth flow using passport.js
)
#12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This pull request is the client side change for the server implementation from CommitStreams Server:
Implement GitHub Authentication using Passport.js
The changes are primarily focused on managing authentication states, handling login/logout flow, and setting up the necessary routes.
Changes:
AuthContext.js
: This file has been updated to handle the authentication states and user profile information. It uses the React Context API to provide a global state for authentication, which can be accessed across the application.Login/Logout Flow
: The login and logout flow has been implemented. On successful GitHub authentication, the user will be redirected to the dashboard/home page. On logout, the user will be redirected back to the login page.Routes
: Routes have been set up for the login and logout process. The/auth/github
route initiates the GitHub authentication process, while the/auth/github/callback
route handles the callback from GitHub after user authentication.