Skip to content

Commit

Permalink
csrf enable
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeMaster482 committed Dec 28, 2023
1 parent 2b1932d commit 85e7d68
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/api/init/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func InitRouter(auth *auth.Handler,

accountRouter := apiRouter.PathPrefix("/account").Subrouter()
accountRouter.Use(authMid.Authentication)
// accountRouter.Use(csrfMid.CheckCSRF)
accountRouter.Use(csrfMid.CheckCSRF)
{
accountRouter.Methods("POST").Path("/create").HandlerFunc(account.Create)
accountRouter.Methods("PUT").Path("/update").HandlerFunc(account.Update)
Expand All @@ -85,7 +85,7 @@ func InitRouter(auth *auth.Handler,

userRouter := apiRouter.PathPrefix("/user").Subrouter()
userRouter.Use(authMid.Authentication)
// userRouter.Use(csrfMid.CheckCSRF)
userRouter.Use(csrfMid.CheckCSRF)
{
userRouter.Methods("PUT").Path("/updatePhoto").HandlerFunc(user.UpdatePhoto)
userRouter.Methods("PUT").Path("/update").HandlerFunc(user.Update)
Expand All @@ -107,7 +107,7 @@ func InitRouter(auth *auth.Handler,

transactionRouter := apiRouter.PathPrefix("/transaction").Subrouter()
transactionRouter.Use(authMid.Authentication)
// transactionRouter.Use(csrfMid.CheckCSRF)
transactionRouter.Use(csrfMid.CheckCSRF)
{
// transactionRouter.Methods("GET").Path("/{transaction_id}/").HandlerFunc(transaction.Get)
transactionRouter.Methods("POST").Path("/create").HandlerFunc(transaction.Create)
Expand All @@ -123,7 +123,7 @@ func InitRouter(auth *auth.Handler,

categoryRouter := apiRouter.PathPrefix("/tag").Subrouter()
categoryRouter.Use(authMid.Authentication)
// categoryRouter.Use(csrfMid.CheckCSRF)
categoryRouter.Use(csrfMid.CheckCSRF)
{
categoryRouter.Methods("POST").Path("/create").HandlerFunc(category.CreateTag)
categoryRouter.Methods("GET").Path("/all").HandlerFunc(category.GetTags)
Expand Down

0 comments on commit 85e7d68

Please sign in to comment.