Skip to content

add auth middleware, correct type in git-username#17

Merged
pakeku merged 2 commits intomasterfrom
erick/profile
May 17, 2025
Merged

add auth middleware, correct type in git-username#17
pakeku merged 2 commits intomasterfrom
erick/profile

Conversation

@pakeku
Copy link
Copy Markdown
Owner

@pakeku pakeku commented May 17, 2025

No description provided.

@pakeku pakeku requested a review from Copilot May 17, 2025 06:42
Copy link
Copy Markdown

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.

Pull Request Overview

This PR introduces an authentication middleware to secure endpoints and corrects the type handling in the git-user-name utility.

  • Updated git-user-name.ts to use the nullish-coalescing operator for improved type handling.
  • Added an authentication middleware and secured the /me route in authRoute.ts.
  • Extended tests in authentication.test.ts to cover the invalid token scenario.

Reviewed Changes

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

File Description
src/utils/git-user-name.ts Replaced "
src/routes/authRoute.ts Imported and applied authMiddleware to secure the '/me' endpoint.
src/midleware/authMiddleware.ts Introduced a new authentication middleware using jwt.verify.
src/http_tests/authentication.test.ts Added tests to validate the behavior with an invalid token.
Comments suppressed due to low confidence (1)

src/routes/authRoute.ts:7

  • The folder name 'midleware' appears to be a misspelling of 'middleware'. Consider updating the folder name for clarity and consistency with common naming conventions.
import authMiddleware from '../midleware/authMiddleware';

Comment thread src/midleware/authMiddleware.ts Outdated
@pakeku pakeku merged commit 270a13b into master May 17, 2025
4 checks passed
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