|
Last change
on this file since fc7b4b4 was fc7b4b4, checked in by stefansaveski <stefansaveski19@…>, 11 months ago |
|
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.
|
-
Property mode
set to
100644
|
|
File size:
553 bytes
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 | namespace iknow_api.Core.Models
|
|---|
| 4 | {
|
|---|
| 5 | public enum UserRole
|
|---|
| 6 | {
|
|---|
| 7 | Admin,
|
|---|
| 8 | Professor,
|
|---|
| 9 | Strudent
|
|---|
| 10 | }
|
|---|
| 11 |
|
|---|
| 12 | public class User
|
|---|
| 13 | {
|
|---|
| 14 | public int Id { get; set; }
|
|---|
| 15 | public string? Name { get; set; }
|
|---|
| 16 | public string? Surname { get; set; }
|
|---|
| 17 | public string? Index { get; set; }
|
|---|
| 18 | public string? Email { get; set; }
|
|---|
| 19 | public string? PasswordHash { get; set; }
|
|---|
| 20 | public DateTime Bday { get; set; }
|
|---|
| 21 | public DateTime CreatedAt { get; set; }
|
|---|
| 22 | public UserRole Role { get; set; }
|
|---|
| 23 | }
|
|---|
| 24 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.