source: iknow-api/Repository/Interface/IUserRepository.cs@ 4e061d8

Last change on this file since 4e061d8 was 5eb7847, checked in by stefansaveski <stefansaveski19@…>, 11 months ago

Add JWT authentication and refactor namespaces

Introduced JWT-based authentication and authorization:

  • Configured JWT authentication in Program.cs with token validation.
  • Added [Authorize] attribute to a new getstring endpoint.

Refactored namespaces for consistency:

  • Updated namespaces from iknow_api.Core.* to iknow_api.*.

Enhanced middleware and dependency injection:

  • Registered IAuthService and IUserRepository.
  • Added app.UseAuthentication() and app.UseAuthorization().

Removed unused code and dependencies:

  • Deleted WeatherForecast class.
  • Cleaned up redundant imports.

Updated project dependencies to include JWT authentication library.

  • Property mode set to 100644
File size: 301 bytes
Line 
1using iknow_api.Models;
2namespace iknow_api.Repositories
3{
4 public interface IUserRepository
5 {
6 Task<bool> UserExistsAsync(string username);
7 Task<User?> GetUserByUsernameAsync(string username);
8 Task AddUserAsync(User user);
9 Task<int> GetUsersCountAsync();
10 }
11}
Note: See TracBrowser for help on using the repository browser.