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

[C4GT Community]: Auth0 Integration and allow Event data edit button to admin users only #133 #159

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

prakharsingh-74
Copy link

@prakharsingh-74 prakharsingh-74 commented Feb 27, 2025

Description

This pull request introduces to integrate Auth0 authentication into the website and implement role-based access control to ensure that only admin users can edit event data and enhancing security and streamline user authentication while preventing unauthorized access to event modifications.

Fixes #133

Type of change

  • New feature (Auth0 integration)

##Dependency Updates:

  • Updated @auth/prisma-adapter to version ^2.7.4 and added @auth0/nextjs-auth0 version ^3.5.0 in package.json.
  • Updated next-auth to version ^4.24.7 in package.json.

##Auth0 Authentication:

  • Added UserProvider to src/app/layout.tsx to wrap the application with Auth0 context.
  • Created a new route src/app/api/auth/[auth0]/route.ts to handle Auth0 authentication. ([src/app/api/auth/[auth0]/route.ts]

##Event Management:

  • Implemented a new event editing page in src/app/(site)/editEvent/[id]/page.tsx with form handling and Firebase integration for updating event data. ([src/app/(site)/editEvent/[id]/page.tsx
  • Added App component in src/app/(site)/editEvent/[id]/_app.tsx to provide Auth0 context to the event editing page. ([src/app/(site)/editEvent/[id]/_app.tsx]

##Event Card Component:

  • Enhanced Event component in src/components/eventData/eventCard.tsx to include an edit button and handle event clicks.

##Miscellaneous:

  • Imported useUser from Auth0 in src/app/(site)/events/page.tsx to manage user authentication state.

##Expected Outcome

  • Only authenticated users can access the platform.
  • Admin users can view and edit event data.
  • Regular users cannot see or access the edit functionality.
  • Unauthorized API requests to modify event data are blocked.
  • Secure and scalable authentication system using Auth0.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code on my localhost
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
404511721-01604001-1688-4c91-9c85-17a636589b2f.mp4

@prakharsingh-74
Copy link
Author

@Durgesh4993 & @MAVRICK-1 kindly check the PR for the issue #133

@prakharsingh-74
Copy link
Author

@MAVRICK-1 & @Durgesh4993 sir, before merging the PR kindly assign this issue to me and on also https://codeforgovtech.in/community-program-projects/ - so that i get the points of it

@prakharsingh-74
Copy link
Author

@MAVRICK-1 sir & @devsayanR sir kindly please check the PR once, and tell me if something has to be get changed

@MAVRICK-1
Copy link
Member

MAVRICK-1 commented Feb 28, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

[C4GT Community]: Auth0 Integration and allow Event data edit button to admin users only
3 participants