-
Notifications
You must be signed in to change notification settings - Fork 0
feat: [KAN-17] user login/logout #5
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
Conversation
There was a problem hiding this 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 implements user login/logout functionality for the ceramicraft-user-mservice with JWT token-based authentication. The implementation includes login/logout API endpoints, password hashing with bcrypt, JWT token generation/validation, and authentication middleware.
- Adds login service with password verification and JWT token generation
- Implements logout endpoint that invalidates auth tokens via cookies
- Introduces authentication middleware for protected routes
Reviewed Changes
Copilot reviewed 22 out of 25 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| server/service/login.go | Core login service implementation with JWT token generation |
| server/service/encrypt.go | Password hashing and verification using bcrypt |
| server/http/api/login.go | HTTP handlers for login/logout endpoints |
| common/utils/jwt_token.go | JWT token generation and validation utilities |
| common/middleware/user_auth.go | Authentication middleware for protected routes |
| server/repository/model/user.go | Increases password field length to accommodate hashed passwords |
| server/http/router/router.go | Registers login/logout routes with authentication middleware |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
836ed4c to
0ecdfff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 23 out of 26 changed files in this pull request and generated 5 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
0ecdfff to
0f3a4b4
Compare
0f3a4b4 to
6c44d6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 25 out of 29 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
6c44d6c to
fccbf4e
Compare
fccbf4e to
17acc4d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 25 out of 29 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
17acc4d to
12d2d49
Compare
12d2d49 to
0fe75b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 25 out of 29 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
0fe75b7 to
eaa0179
Compare
eaa0179 to
8c453ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 25 out of 29 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
8c453ef to
2477edf
Compare
2477edf to
74061c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 25 out of 29 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
6b0f083 to
ef93d55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 25 out of 29 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ef93d55 to
ec86386
Compare
ec86386 to
3a26740
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 26 out of 30 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
3a26740 to
f22b919
Compare
f22b919 to
79e30be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 25 out of 29 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
79e30be to
259227c
Compare
259227c to
be4130c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 25 out of 29 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
623423b to
1b898ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 26 out of 30 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
1b898ff to
5b11815
Compare
5b11815 to
4c163c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 26 out of 30 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| err := os.Setenv("JWT_SECRET", "TEST_SECRET_KEY") | ||
| if err != nil { | ||
| panic(err) | ||
| } |
Copilot
AI
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using panic in tests is not recommended. Consider using t.Fatal() or t.Fatalf() to properly handle test failures instead of panic.
4738ab2 to
a265008
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 26 out of 30 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
a265008 to
74f26a7
Compare
name: Pull Request
about: user login/logout
labels: ["new feature"]
变更内容 | Changes
add login/logout API
相关 Issue | Related Issue
KAN-17 Customer Login
变更类型 | Type of Change
检查清单 | Checklist
变更影响 | Impact
none
测试说明 | Test Instructions
testuser@u.nus.edu, password=123456auth-token其他说明 | Additional Notes