mirror of
https://github.com/yusing/godoxy.git
synced 2026-02-23 10:54:50 +01:00
- These changes makes the API incombatible with previous versions - Added new types for error handling, success responses, and health checks. - Updated health check logic to utilize the new types for better clarity and structure. - Refactored existing handlers to improve response consistency and error handling. - Updated Makefile to include a new target for generating API types from Swagger. - Updated "new agent" API to respond an encrypted cert pair
20 lines
533 B
Go
20 lines
533 B
Go
package auth
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/yusing/go-proxy/internal/auth"
|
|
)
|
|
|
|
// @x-id "check"
|
|
// @Base /api/v1
|
|
// @Summary Check authentication status
|
|
// @Description Checks if the user is authenticated by validating their token
|
|
// @Tags auth
|
|
// @Produce plain
|
|
// @Success 200 {string} string "OK"
|
|
// @Failure 403 {string} string "Forbidden: use X-Redirect-To header to redirect to login page"
|
|
// @Router /auth/check [head]
|
|
func Check(c *gin.Context) {
|
|
auth.AuthCheckHandler(c.Writer, c.Request)
|
|
}
|