Ignore:
Timestamp:
10/22/25 22:40:03 (11 months ago)
Author:
stefansaveski <stefansaveski19@…>
Branches:
master
Children:
41e4f9f
Parents:
d025ba3
Message:

Implement JWT Authentication and Update User Schema

Replaced repository interface with FinXaccesApi.Repositories in UsersControllers.cs. Updated database schema to use PasswordHash instead of Password. Added new migration files reflecting these changes. Updated service registration in Program.cs to include IAuthService and IUserRepository. Refactored UserRepository.cs and IUserRepository.cs with new methods and namespace changes. Commented out UserService.cs. Updated appsettings with new connection strings and JWT settings. Added BCrypt.Net-Next and System.IdentityModel.Tokens.Jwt packages. Introduced AuthController, UserDTO, AuthService, and IAuthService for handling authentication and user management.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • iknow-api/Repository/Interface/IUserRepository.cs

    rd025ba3 r5b42c8d  
    1 using System.Threading;
    2 using System.Threading.Tasks;
    31using iknow_api.Core.Models;
    4 
    5 namespace iknow_api.Repository.Interfaces
     2namespace FinXaccesApi.Repositories
    63{
    74    public interface IUserRepository
    85    {
    9         Task<bool> EmailExistsAsync(string email, CancellationToken cancellationToken = default);
    10         Task<User> AddUserAsync(User user, CancellationToken cancellationToken = default);
    11         Task<User?> GetUserByIdAsync(int id, CancellationToken cancellationToken = default);
     6        Task<bool> UserExistsAsync(string username);
     7        Task<User?> GetUserByUsernameAsync(string username);
     8        Task AddUserAsync(User user);
     9        Task<int> GetUsersCountAsync();
    1210    }
    1311}
Note: See TracChangeset for help on using the changeset viewer.