Skip to content

Commit

Permalink
feat(websocket): Add jwt module to ws connection
Browse files Browse the repository at this point in the history
  • Loading branch information
kasugamirai committed Sep 9, 2024
1 parent 305433b commit 251d6e1
Show file tree
Hide file tree
Showing 18 changed files with 1,455 additions and 110 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
2 changes: 1 addition & 1 deletion api/internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func initEcho(ctx context.Context, cfg *ServerConfig) *echo.Echo {
// apis
api := e.Group("/api")
api.GET("/ping", Ping(), privateCache)

api.GET("/validate-token", ValidateToken())
apiPrivate := api.Group("", privateCache)
apiPrivate.POST("/graphql", GraphqlAPI(cfg.Config.GraphQL, gqldev))

Expand Down
8 changes: 8 additions & 0 deletions api/internal/app/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,11 @@ func SignupVerify() echo.HandlerFunc {
return c.JSON(http.StatusOK, output)
}
}

func ValidateToken() echo.HandlerFunc {
return func(c echo.Context) error {
return c.JSON(http.StatusOK, map[string]interface{}{
"status": "authenticated",
})
}
}
Loading

0 comments on commit 251d6e1

Please sign in to comment.