refactor: add token to ping response message

This commit is contained in:
Derrick Hammer 2024-03-18 17:19:52 -04:00
parent 26a6bda053
commit d1c5bde5c1
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 7 additions and 2 deletions

View File

@ -287,9 +287,11 @@ func (a AccountAPI) passwordResetConfirm(jc jape.Context) {
} }
func (a AccountAPI) ping(jc jape.Context) { func (a AccountAPI) ping(jc jape.Context) {
token := middleware.GetAuthTokenFromContext(jc.Request.Context())
account.EchoAuthCookie(jc, a.Name()) account.EchoAuthCookie(jc, a.Name())
jc.Encode(&PongResponse{ jc.Encode(&PongResponse{
Ping: "pong", Ping: "pong",
Token: token,
}) })
} }

View File

@ -45,7 +45,8 @@ type PasswordResetVerifyRequest struct {
} }
type PongResponse struct { type PongResponse struct {
Ping string `json:"ping"` Ping string `json:"ping"`
Token string `json:"token"`
} }
type AccountInfoResponse struct { type AccountInfoResponse struct {
ID uint `json:"id"` ID uint `json:"id"`

View File

@ -253,6 +253,8 @@ components:
properties: properties:
ping: ping:
type: string type: string
token:
type: string
AccountInfoResponse: AccountInfoResponse:
type: object type: object
properties: properties: