chore: add api docs (#1965)

This commit is contained in:
boojack
2023-07-15 23:30:20 +08:00
committed by GitHub
parent 01f4780655
commit 2effacd0a6
11 changed files with 808 additions and 1 deletions

View File

@ -33,6 +33,7 @@ type SignUp struct {
}
func (s *APIV1Service) registerAuthRoutes(g *echo.Group) {
// POST /auth/signin - Sign in.
g.POST("/auth/signin", func(c echo.Context) error {
ctx := c.Request().Context()
signin := &SignIn{}
@ -67,6 +68,7 @@ func (s *APIV1Service) registerAuthRoutes(g *echo.Group) {
return c.JSON(http.StatusOK, user)
})
// POST /auth/signin/sso - Sign in with SSO
g.POST("/auth/signin/sso", func(c echo.Context) error {
ctx := c.Request().Context()
signin := &SSOSignIn{}
@ -153,6 +155,7 @@ func (s *APIV1Service) registerAuthRoutes(g *echo.Group) {
return c.JSON(http.StatusOK, user)
})
// POST /auth/signup - Sign up a new user.
g.POST("/auth/signup", func(c echo.Context) error {
ctx := c.Request().Context()
signup := &SignUp{}
@ -218,6 +221,7 @@ func (s *APIV1Service) registerAuthRoutes(g *echo.Group) {
return c.JSON(http.StatusOK, user)
})
// POST /auth/signout - Sign out.
g.POST("/auth/signout", func(c echo.Context) error {
auth.RemoveTokensAndCookies(c)
return c.JSON(http.StatusOK, true)