Commit graph

16 commits

Author SHA1 Message Date
Pat Hartl
93753efde5 Return unauthorized error message with login 2025-01-25 13:46:33 -06:00
Pat Hartl
7ed1cdebe2 Add login via auth provider to launcher 2025-01-05 21:09:57 -06:00
Pat Hartl
e6301fb4ba Get authentication providers via API 2025-01-03 00:55:22 -06:00
Pat Hartl
f81ae1244d Fix login redirect URI 2025-01-02 18:47:04 -06:00
Pat Hartl
8ac25adf61 Provide route to get API token using authentication provider 2025-01-01 19:24:35 -06:00
Pat Hartl
d5d90d3f35 Change login route 2024-12-28 03:47:02 -06:00
Pat Hartl
e9c542ab49 Rename async controller routes 2024-11-12 23:22:01 -06:00
Pat Hartl
00b9ca5953 Rename service and repository methods to async 2024-11-12 18:32:46 -06:00
Pat Hartl
3dd91b3b0d Switch all DateTime.Now to use UTC 2024-10-23 23:16:52 -05:00
Pat Hartl
2056b06207 Working new login page 2024-10-18 19:15:05 -05:00
Pat Hartl
991771a7f3 Use string constant for administrator role name 2024-10-16 02:06:02 -05:00
Pat Hartl
2805f34449 WIP fix for MySQL connection concurrency issues
This is a large commit. There are a number of things that this commit does to try to fix various issues that were occurring when the database provider was set to MySQL:
- The DAL `Repository` has been completely refactored to follow best practices. The repository is now being injected into services instead of the database context itself. This allows the DI to handle the repository's lifetime instead of creating a new repository for every transaction and sharing the context across repositories. As part of these changes, there is no more allowed usage of `IQueryable` and all service/repository methods must actually execute database queries before their return. This is to ensure that the context does not stay open longer than it needs to. Abusing `IQueryable`s by tossing them into Blazor components seems to be a big no-no.
- Some deletion behaviors on relationships have been tweaked as MySQL wasn't able to apply migrations with behaviors that were contradictory.
- A `ConnectionInterceptor` was added to try to keep track of `DatabaseContext` lifetimes. This is really only for debugging and should be put into `#if DEBUG` regions. This helped identify some potential issues where some contexts were basically never closing, causing the MySQL connector to not function.
- Docs for generating migrations have been updated to reflect the addition of being able to specify the database provider and connection string when adding a migration, avoiding the need to edit `Settings.yml`
- The application can now be put into a pause state on startup by adding the `--debugger` argument when used from the command line. When a debugger is attached, it resumes execution.
- The application can now log to Seq when using debug build
- Service lifetime on `DatabaseContext` has switched to transient. This may be reverted in the future.
- Lazy loading has been disabled for debugging purposes. It didn't directly help the concurrency issues, but it needs to be tested individually to be re-enabled.
- All usage of `UserManager`, `RoleManager`, and `SignInManager` have been removed from all controllers, pages, and Blazor components. Functionality has been moved to `UserService` and `RoleService`. This might have done the most amount of help, but could probably be improved upon in the future by not relying on them and instead having our own implementation.
- Application startup migrations and server autostarts have been disabled temporarily. There might be an issue of `DatabaseContext` lifetimes that spawn from this.
2024-10-13 20:42:45 -05:00
Pat Hartl
5d3ff9cada More logging and error handling for API routes 2024-09-17 00:18:39 -05:00
Pat Hartl
f060ad7ac4 Consolidate settings access 2024-08-28 20:44:14 -05:00
Pat Hartl
1c615cbce2 Remove nlog, use Serilog, prefer ILogger 2024-08-28 20:33:59 -05:00
Pat Hartl
cb061e09c5 Rename server project 2024-08-04 18:44:33 -05:00
Renamed from LANCommander/Controllers/Api/AuthController.cs (Browse further)