forked from CodeBeamOrg/UltimateAuth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIUAuthStateManager.cs
More file actions
35 lines (30 loc) · 923 Bytes
/
IUAuthStateManager.cs
File metadata and controls
35 lines (30 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
namespace CodeBeam.UltimateAuth.Client.Authentication;
/// <summary>
/// Orchestrates the lifecycle of UAuthState.
/// This is the single authority responsible for keeping
/// client-side authentication state in sync with the server.
/// </summary>
public interface IUAuthStateManager
{
/// <summary>
/// Current in-memory authentication state.
/// </summary>
UAuthState State { get; }
/// <summary>
/// Ensures the authentication state is valid.
/// May call server validate/refresh if needed.
/// </summary>
Task EnsureAsync(CancellationToken ct = default);
/// <summary>
/// Called after a successful login.
/// </summary>
Task OnLoginAsync();
/// <summary>
/// Called after logout.
/// </summary>
Task OnLogoutAsync();
/// <summary>
/// Forces state to be cleared and re-validation required.
/// </summary>
void MarkStale();
}