Enum AuthState
Unified authentication state for all server types. Replaces the former SrpState enum and implicit in-flight flags with a single atomic enum that tracks the full connection lifecycle.
public enum AuthState : byte
Fields
Authenticated = 7Fully authenticated. Terminal state.
Handshake = 1Handshake received. Encryption keys established. Next: VerifyPending (SRP) or TokenPending (token).
None = 0No authentication state. Connection exists but handshake has not completed.
ProofPending = 4SRP proof request enqueued for async worker processing.
SrpSuccess = 5SRP proof validated, login in progress.
TokenPending = 6Token auth request enqueued for async worker processing.
VerifyPending = 2SRP verify request enqueued for async worker processing.
WaitingForProof = 3SRP verify completed, SRP data established. Waiting for client proof.
Remarks
State machine:
SRP flow: None → Handshake → VerifyPending → WaitingForProof → ProofPending → SrpSuccess → Authenticated
Token flow: None → Handshake → TokenPending → Authenticated
All transitions are performed atomically via TryAdvanceAuthState under the
AccountManager lock. The enum values are intentionally ordered so that
state > AuthState.Handshake means "auth is in progress."
DO NOT RENUMBER — sweep logic and guard checks rely on ordinal comparisons.