diff --git a/api/account/account.go b/api/account/account.go index e68222f..56ec3a4 100644 --- a/api/account/account.go +++ b/api/account/account.go @@ -287,9 +287,11 @@ func (a AccountAPI) passwordResetConfirm(jc jape.Context) { } func (a AccountAPI) ping(jc jape.Context) { + token := middleware.GetAuthTokenFromContext(jc.Request.Context()) account.EchoAuthCookie(jc, a.Name()) jc.Encode(&PongResponse{ - Ping: "pong", + Ping: "pong", + Token: token, }) } diff --git a/api/account/messages.go b/api/account/messages.go index 31a83e7..e7db08f 100644 --- a/api/account/messages.go +++ b/api/account/messages.go @@ -45,7 +45,8 @@ type PasswordResetVerifyRequest struct { } type PongResponse struct { - Ping string `json:"ping"` + Ping string `json:"ping"` + Token string `json:"token"` } type AccountInfoResponse struct { ID uint `json:"id"` diff --git a/api/account/swagger.yaml b/api/account/swagger.yaml index 0a62a8d..7f8dd21 100644 --- a/api/account/swagger.yaml +++ b/api/account/swagger.yaml @@ -253,6 +253,8 @@ components: properties: ping: type: string + token: + type: string AccountInfoResponse: type: object properties: