|
Last change
on this file since e49c3ed was e49c3ed, 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:
291 bytes
|
| Line | |
|---|
| 1 | using Microsoft.EntityFrameworkCore;
|
|---|
| 2 | using iknow_api.Models;
|
|---|
| 3 |
|
|---|
| 4 | namespace iknow_api.Data
|
|---|
| 5 | {
|
|---|
| 6 | public class AppDbContext : DbContext
|
|---|
| 7 | {
|
|---|
| 8 | public AppDbContext(DbContextOptions<AppDbContext> options)
|
|---|
| 9 | : base(options) { }
|
|---|
| 10 |
|
|---|
| 11 | public DbSet<User> User { get; set; }
|
|---|
| 12 | }
|
|---|
| 13 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.