-
Notifications
You must be signed in to change notification settings - Fork 0
Develop #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
Develop #5
Conversation
Introduced SecureTokenStorage for encrypted token management and updated LoginViewModel to support token persistence and auto-login. Added IsSynced property to key models (Account, Budget, Category, Transaction, UserSettings, BudgetCategory) to track synchronization status. Updated AuthService base address.
…torage Introduces a new HomeViewModel class inheriting from ObservableObject for MVVM support. Also reorders using directives in SecureTokenStorage.cs for consistency.
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 introduces security enhancements and synchronization tracking into the FinTrack project by integrating secure token storage in the authentication workflow and adding an IsSynced property to various models.
- Integrates SecureTokenStorage into LoginViewModel to automatically log in users with saved tokens.
- Adds an IsSynced property to multiple models to track synchronization status.
- Updates AuthService base URL and introduces a placeholder HomeViewModel.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| FinTrack/ViewModels/LoginViewModel.cs | Integrates secure token login and token saving in authentication flow |
| FinTrack/ViewModels/HomeViewModel.cs | Adds a placeholder HomeViewModel class |
| FinTrack/Services/AuthService.cs | Updates the AuthService base URL |
| FinTrack/Models/UserSettingsModel.cs | Adds IsSynced property for sync status tracking |
| FinTrack/Models/TransactionModel.cs | Adds IsSynced property for sync status tracking |
| FinTrack/Models/CategoryModel.cs | Adds IsSynced property for sync status tracking |
| FinTrack/Models/BudgetModel.cs | Adds IsSynced property for sync status tracking |
| FinTrack/Models/BudgetCategoryModel.cs | Adds IsSynced property for sync status tracking |
| FinTrack/Models/AccountModel.cs | Adds IsSynced property for sync status tracking |
| FinTrack/Core/SecureTokenStorage.cs | Implements secure token storage using ProtectedData |
| if (!string.IsNullOrEmpty(token)) | ||
| { | ||
| SessionManager.SetToken(token); | ||
| MessageBox.Show("Giriş başarılı! Token kullanıldı.", "Bilgi", MessageBoxButton.OK, MessageBoxImage.Information); |
Copilot
AI
Jun 27, 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.
[nitpick] Consider decoupling UI messaging from the ViewModel by using an event or messaging service instead of directly calling MessageBox.Show to improve testability and separation of concerns.
| } | ||
| catch (Exception ex) | ||
| { | ||
| Console.WriteLine($"Error saving token: {ex.Message}"); |
Copilot
AI
Jun 27, 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.
Consider replacing Console.WriteLine with a proper logging framework to improve error tracking and maintainability in production environments.
This pull request introduces several key updates to the
FinTrackproject, including a new secure token storage mechanism, synchronization status tracking for models, and enhancements to authentication workflows. Additionally, minor changes were made to the base address of theAuthServiceand a placeholderHomeViewModelwas added.Security and Authentication Enhancements:
SecureTokenStorageclass: Implements secure storage for user tokens usingProtectedDatafor encryption and decryption, with methods to save, retrieve, and clear tokens. (FinTrack/Core/SecureTokenStorage.cs)LoginViewModel: IntegratedSecureTokenStorageto automatically log in users with a saved token and to save tokens upon successful login. (FinTrack/ViewModels/LoginViewModel.cs) [1] [2]Model Synchronization:
IsSyncedproperty: Introduced abool IsSyncedproperty to track synchronization status for the following models:AccountModel(FinTrack/Models/AccountModel.cs)BudgetCategoryModel(FinTrack/Models/BudgetCategoryModel.cs)BudgetModel(FinTrack/Models/BudgetModel.cs)CategoryModel(FinTrack/Models/CategoryModel.cs)TransactionModel(FinTrack/Models/TransactionModel.cs)UserSettingsModel(FinTrack/Models/UserSettingsModel.cs)Minor Updates:
AuthServicebase address: Changed the base URL fromhttp://localhost:5246/tohttp://localhost:5000/. (FinTrack/Services/AuthService.cs)HomeViewModel: Created a placeholderHomeViewModelclass inheriting fromObservableObject. (FinTrack/ViewModels/HomeViewModel.cs)