refactor: add token to ping response message
This commit is contained in:
parent
26a6bda053
commit
d1c5bde5c1
|
@ -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,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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"`
|
||||||
|
|
|
@ -253,6 +253,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
ping:
|
ping:
|
||||||
type: string
|
type: string
|
||||||
|
token:
|
||||||
|
type: string
|
||||||
AccountInfoResponse:
|
AccountInfoResponse:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
Loading…
Reference in New Issue