Files
jdescopingtool/NEW/src/JdeScoping.Client/Auth/IAuthStateProvider.cs
T
Joseph Doherty 604bfe919c refactor: address code review findings across all projects
Apply comprehensive fixes from code reviews including:
- Extract shared utilities (SqlFormatHelper, CellValueConverter, DbDestinationBase)
- Add interface abstractions (IAuthenticationService, IDatabaseMigrator, IMisQueryBuilder)
- Implement SecureStore for encrypted secrets storage
- Fix error handling with proper HTTP status codes and logging
- Optimize double enumeration in DevEtlRegistry
- Add DataSync.Dev README for developer onboarding
- Extract filter panel base classes to reduce duplication
- Update code review docs to mark all issues as fixed
2026-01-19 11:05:36 -05:00

33 lines
1.0 KiB
C#

using JdeScoping.Core.Models.Auth;
namespace JdeScoping.Client.Auth;
/// <summary>
/// Interface for managing authentication state in the Blazor client.
/// Extracted from AuthStateProvider for testability.
/// </summary>
public interface IAuthStateProvider
{
/// <summary>
/// Called after successful login to update auth state and persist user info.
/// </summary>
/// <param name="user">Authenticated user info from the server.</param>
Task MarkUserAsAuthenticated(UserInfoDto user);
/// <summary>
/// Notifies that authentication state has changed, triggering a re-evaluation.
/// </summary>
void NotifyAuthenticationStateChanged();
/// <summary>
/// Logs out the user by removing cached data and notifying of state change.
/// </summary>
Task LogoutAsync();
/// <summary>
/// Gets the current username from the cached user info.
/// </summary>
/// <returns>The username if authenticated, null otherwise.</returns>
Task<string?> GetUsernameAsync();
}