Refactor authentication and database handling

- Introduced `AuthController` for user registration and login.
- Added `DatabaseService` to manage user-related database operations.
- Created `HelperService` for utility functions like JSON parsing and token generation.
- Updated `Program.cs` to register new services and controllers.
- Modified `login.js` and `register.js` to use new API endpoints.
- Cleaned up project file by removing unused class and ensuring proper compilation.
- Overall improvements enhance application structure, security, and functionality.
This commit is contained in:
whoswhip
2025-07-06 18:17:54 -04:00
parent e6e6bf9ee6
commit 73248e723a
8 changed files with 744 additions and 223 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ document.addEventListener('DOMContentLoaded', function () {
: { username: username, password: password };
const response = await fetch('/api/accounts/login', {
const response = await fetch('/api/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
+1 -1
View File
@@ -54,7 +54,7 @@ document.addEventListener('DOMContentLoaded', function() {
}
const response = await fetch('/api/accounts/register', {
const response = await fetch('/api/auth/register', {
method: 'POST',
headers: {
'Content-Type': 'application/json'