@startuml
title Session IP Capture (After)
skinparam backgroundColor #FFFFFF
skinparam sequence {
  ArrowColor #065F46
  LifeLineBorderColor #10B981
  LifeLineBackgroundColor #ECFDF5
  ParticipantBorderColor #047857
  ParticipantBackgroundColor #D1FAE5
}

actor Client
participant "Axum Router\n(connect info enabled)" as Axum
participant "convert_axum_request" as Convert
participant "AuthContext::extract_client_ip" as Extract
database "sessions" as Sessions

Client -> Axum: POST /sign-up/email\n(no proxy IP headers)
Axum -> Convert: Request + ConnectInfo<SocketAddr>
Convert -> Convert: if no external IP header\ninject x-athena-client-ip
Convert -> Extract: header-first lookup
Extract --> Convert: ip_address = remote socket IP
Convert -> Sessions: create_session(ip_address = resolved)
Sessions --> Client: session row persisted\n(ip_address non-NULL)

note right of Extract
Precedence preserved:\nproxy headers first,\ninternal fallback only when absent.
end note

@enduml