@startuml
skinparam backgroundColor white
skinparam defaultFontColor black
skinparam ArrowColor black
skinparam SequenceLifeLineBorderColor black
skinparam SequenceLifeLineBackgroundColor #F6F6F6
skinparam ParticipantBorderColor black
skinparam ParticipantBackgroundColor #EAF4FF
skinparam NoteBackgroundColor #E8F8E8
skinparam NoteBorderColor black

title Legacy /api/auth Prefix Flow (After Shim)

actor Client as client
participant "Axum Router" as router #DCEBFF
participant "dispatch_auth_request" as dispatch #FFF2CC
participant "rewrite_legacy_auth_base_path" as shim #FDE9D9
participant "AthenaAuth::handle_request" as auth #E6FFEA

client -> router: ANY /api/auth/sign-in/email?disableCookieCache=true
router -> dispatch: Forward request

dispatch -> shim: rewrite_legacy_auth_base_path(req)
shim --> dispatch: path -> /sign-in/email\nquery preserved
note right of shim
Method is untouched.
Rewrite applies to GET/POST/PUT/PATCH/DELETE, etc.
end note

dispatch -> auth: path = /sign-in/email
auth --> dispatch: Matched handler response

dispatch --> client: Normal auth response
@enduml
