Repository navigation
Fix/idn 02 controller - #45
Merged
Merged
Conversation
… merged tests for these controllers into АuthControllerTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Component and requirement IDs
Changes
Verification
Architecture and data flow
This pull request consolidates the authentication-related API endpoints (
login,logout, andme) into a singleAuthController, introduces new service interfaces for login and logout operations, and updates the dependency injection and tests accordingly. The changes improve code organization, testability, and adherence to interface-based programming.Key changes include:
API Controller Refactoring:
LoginController,LogoutController, andMeControllerinto a unifiedAuthControllerhandling all authentication endpoints (/api/auth/login,/api/auth/logout,/api/auth/me). This centralizes authentication logic and simplifies route management. [1] [2] [3] [4]Service Abstraction and Implementation:
ILoginServiceandILogoutServiceinterfaces to abstract login and logout logic, and updatedLoginServiceandLogoutServiceto implement these interfaces. This enhances testability and flexibility for authentication services. [1] [2] [3] [4]Dependency Injection Updates:
Program.csto use the newILoginServiceandILogoutServiceabstractions and replaced the oldLogoutAccountwithLogoutService.Test Suite Improvements:
AuthControllerTests, which now cover all endpoints in the unified controller. Removed obsolete controller tests and updated logout service tests to match the new service and controller structure. [1] [2] [3] [4] [5] [6]File and Naming Consistency:
LogoutAccounttoLogoutServiceand ensured consistent naming across services, controllers, and tests for clarity and maintainability. [1] [2]These changes collectively modernize and streamline the authentication subsystem, making it easier to maintain and extend.
Security checks and negative tests
Dependencies