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) {
token := middleware.GetAuthTokenFromContext(jc.Request.Context())
account.EchoAuthCookie(jc, a.Name())
jc.Encode(&PongResponse{
Ping: "pong",
Token: token,
})
}

View File

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

View File

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