diff --git a/api/account/account.go b/api/account/account.go index 77c19ea..7ddab1c 100644 --- a/api/account/account.go +++ b/api/account/account.go @@ -264,6 +264,12 @@ func (a AccountAPI) passwordResetConfirm(jc jape.Context) { jc.ResponseWriter.WriteHeader(http.StatusOK) } +func (a AccountAPI) pong(jc jape.Context) { + jc.Encode(&PongResponse{ + Ping: "pong", + }) +} + func (a AccountAPI) Routes() (*httprouter.Router, error) { authMw2fa := authMiddleware(middleware.AuthMiddlewareOptions{ Identity: a.identity, @@ -280,6 +286,7 @@ func (a AccountAPI) Routes() (*httprouter.Router, error) { }) routes := map[string]jape.Handler{ + "POST /api/auth/ping": middleware.ApplyMiddlewares(a.pong, authMw2fa, middleware.ProxyMiddleware), "POST /api/auth/login": middleware.ApplyMiddlewares(a.login, authMw2fa, middleware.ProxyMiddleware), "POST /api/auth/register": middleware.ApplyMiddlewares(a.register, middleware.ProxyMiddleware), "POST /api/auth/verify-email": middleware.ApplyMiddlewares(a.verifyEmail, middleware.ProxyMiddleware), diff --git a/api/account/messages.go b/api/account/messages.go index 6dc7eba..4a2a0b3 100644 --- a/api/account/messages.go +++ b/api/account/messages.go @@ -42,3 +42,7 @@ type PasswordResetVerifyRequest struct { Token string `json:"token"` Password string `json:"password"` } + +type PongResponse struct { + Ping string `json:"ping"` +} diff --git a/api/account/swagger.yaml b/api/account/swagger.yaml index 2e57678..c282dd3 100644 --- a/api/account/swagger.yaml +++ b/api/account/swagger.yaml @@ -118,6 +118,14 @@ paths: responses: '200': description: Password reset successfully + /api/auth/pong: + get: + summary: Auth check endpoint + responses: + '200': + description: Pong + '401': + description: Unauthorized components: schemas: