@startuml
title Demo Auth Proxy 404 Behavior (Before)
skinparam backgroundColor #FFFFFF
skinparam sequence {
  ArrowColor #334155
  LifeLineBorderColor #475569
  LifeLineBackgroundColor #F8FAFC
  ParticipantBorderColor #334155
  ParticipantBackgroundColor #EEF2FF
  ParticipantFontColor #0F172A
  ActorBorderColor #0F172A
  ActorBackgroundColor #DBEAFE
}

actor "apps/demo UI" as UI
participant "Next.js API\n/api/auth/[...path]" as Proxy #E0F2FE
participant "athena-auth upstream\n(configured origin)" as Upstream #F1F5F9

UI -> Proxy: POST /api/auth/sign-in/email
activate Proxy
Proxy -> Upstream: POST /sign-in/email (or configured base path)
activate Upstream
Upstream --> Proxy: 404 Not Found\n{ "message": "Not Found" }
deactivate Upstream
Proxy --> UI: 404 passthrough\nminimal context in body
note right of Proxy #FEE2E2
Before change:
- Attempted upstream route only visible in server logs
- API caller lacks structured route diagnostics
- Harder to debug base-path mismatches quickly
end note
deactivate Proxy
@enduml
