Skip to content

Commit

Permalink
Merge pull request #1212 from getfider/paddle-fix
Browse files Browse the repository at this point in the history
Remove the paddle webhooks from CSRF checks.
  • Loading branch information
mattwoberts authored Sep 25, 2024
2 parents b2c1311 + 7628054 commit a7257e8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions app/cmd/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func routes(r *web.Engine) *web.Engine {
})

r.Use(middlewares.Secure())
r.Use(middlewares.CSRF())
r.Use(middlewares.Compress())

assets := r.Group()
Expand All @@ -56,13 +55,6 @@ func routes(r *web.Engine) *web.Engine {
r.Use(middlewares.User())

r.Get("/privacy", handlers.LegalPage("Privacy Policy", "privacy.md"))
r.Get("/terms", handlers.LegalPage("Terms of Service", "terms.md"))

r.Post("/_api/tenants", handlers.CreateTenant())
r.Get("/_api/tenants/:subdomain/availability", handlers.CheckAvailability())
r.Get("/signup", handlers.SignUp())
r.Get("/oauth/:provider", handlers.SignInByOAuth())
r.Get("/oauth/:provider/callback", handlers.OAuthCallback())

if env.IsBillingEnabled() {
wh := r.Group()
Expand All @@ -71,6 +63,16 @@ func routes(r *web.Engine) *web.Engine {
}
}

r.Use(middlewares.CSRF())

r.Get("/terms", handlers.LegalPage("Terms of Service", "terms.md"))

r.Post("/_api/tenants", handlers.CreateTenant())
r.Get("/_api/tenants/:subdomain/availability", handlers.CheckAvailability())
r.Get("/signup", handlers.SignUp())
r.Get("/oauth/:provider", handlers.SignInByOAuth())
r.Get("/oauth/:provider/callback", handlers.OAuthCallback())

//Starting from this step, a Tenant is required
r.Use(middlewares.RequireTenant())

Expand Down

0 comments on commit a7257e8

Please sign in to comment.