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: Implement authentication and database setup with UI improvements #18

Merged
merged 10 commits into from
Jan 1, 2025

Conversation

Alvalens
Copy link
Member

@Alvalens Alvalens commented Jan 1, 2025

Description

Introduce NextAuth for authentication, set up Prisma with a User model, and enhance the landing page and layout styles. Update references from GDSC to GDGoC and improve the footer logo.

Changes

  1. Added user authentication logic to handle login with email and password.
  2. Implemented session management to track authenticated users.
  3. Integrated error handling for invalid credentials and login failures.
  4. Updated Prisma schema and database models.
  5. Fix and improve some admin panel ui

How Has This Been Tested?

Manual testing of the backend authentication process

  • Tested successful login with valid credentials.
  • Tested failed login attempts with incorrect credentials (invalid email/password).

Note: The frontend-related tests are pending resolution due to issues outside the scope of this PR.

@Copilot Copilot bot review requested due to automatic review settings January 1, 2025 09:51
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 8 out of 23 changed files in this pull request and generated 1 comment.

Files not reviewed (15)
  • .env.example: Language not supported
  • package.json: Language not supported
  • prisma/migrations/20241230150056_init/migration.sql: Language not supported
  • prisma/migrations/20250101092221_init/migration.sql: Language not supported
  • prisma/schema.prisma: Language not supported
  • app/_app.tsx: Evaluated as low risk
  • app/_document.tsx: Evaluated as low risk
  • app/admin/layout.tsx: Evaluated as low risk
  • app/admin/dashboard/page.tsx: Evaluated as low risk
  • app/auth/login/page.tsx: Evaluated as low risk
  • prisma/migrations/migration_lock.toml: Evaluated as low risk
  • app/layout.tsx: Evaluated as low risk
  • app/providers/NextAuthProvider.tsx: Evaluated as low risk
  • app/(user)/layout.tsx: Evaluated as low risk
  • app/context/sessionContext.tsx: Evaluated as low risk
Comments suppressed due to low confidence (1)

lib/auth.ts:23

  • [nitpick] The variable name 'user' could be more descriptive, such as 'fetchedUser', to indicate that it represents a user fetched from the database.
const user = await prisma.user.findUnique({

lib/auth.ts Show resolved Hide resolved
@Alvalens Alvalens merged commit 5de23d4 into main Jan 1, 2025
0 of 2 checks passed
@Alvalens Alvalens deleted the backend/auth-login branch January 3, 2025 14:10
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.

2 participants