Skip to content

Conversation

@leticiadia
Copy link
Contributor

🔐 Implement Authentication Module and Related Features

📦 Package and File Updates:

  • Updated project dependencies (package update).
  • Removed unused or obsolete files.

🧩 Authentication Module Setup:

  • Added AuthModule, AuthService, and AuthController to handle authentication logic.
  • Created jwt-secret.ts file to manage JWT secret configuration.

✅ Validations Implemented:

  • Added validation to check if a user exists by name.
  • Added validation to check if a post exists in findPostBySlug.

🔑 Authentication Methods:

Created the following methods:

  • authenticate
  • validateUser
  • signIn

🌐 Routes Added:

Added routes for:

  • Login
  • User profile

🛠️ JWT Setup and Security:

Configured AuthModule with:

  • JWT strategy
  • Token expiration settings
  • Implemented JwtStrategy to extract and validate JWT payloads.
  • Added JwtAuthGuard extending the default JWT strategy.
  • Added AuthGuard to perform JWT verification and inject user data into requests.

@leticiadia leticiadia added enhancement New feature or request refactor Improves code structure and readability without changing behavior labels Aug 12, 2025
@leticiadia leticiadia merged commit a1b1c02 into main Aug 12, 2025
2 checks passed
@leticiadia leticiadia deleted the feature/user-auth branch August 12, 2025 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor Improves code structure and readability without changing behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants