Skip to content

Commit

Permalink
Missing route
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwoberts committed Sep 30, 2024
1 parent 103807a commit 1003796
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/cmd/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func routes(r *web.Engine) *web.Engine {
r.Get("/oauth/:provider", handlers.SignInByOAuth())
r.Get("/oauth/:provider/callback", handlers.OAuthCallback())

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

r.Get("/sitemap.xml", handlers.Sitemap())
Expand All @@ -98,7 +98,7 @@ func routes(r *web.Engine) *web.Engine {
r.Get("/oauth/:provider/token", handlers.OAuthToken())
r.Get("/oauth/:provider/echo", handlers.OAuthEcho())

//If tenant is pending, block it from using any other route
// If tenant is pending, block it from using any other route
r.Use(middlewares.BlockPendingTenants())

r.Get("/signin", handlers.SignInPage())
Expand All @@ -108,7 +108,7 @@ func routes(r *web.Engine) *web.Engine {
r.Post("/_api/signin/complete", handlers.CompleteSignInProfile())
r.Post("/_api/signin", handlers.SignInByEmail())

//Block if it's private tenant with unauthenticated user
// Block if it's private tenant with unauthenticated user
r.Use(middlewares.CheckTenantPrivacy())

r.Get("/", handlers.Index())
Expand All @@ -117,12 +117,13 @@ func routes(r *web.Engine) *web.Engine {

ui := r.Group()
{
//From this step, a User is required
// From this step, a User is required
ui.Use(middlewares.IsAuthenticated())

ui.Get("/settings", handlers.UserSettings())
ui.Get("/notifications", handlers.Notifications())
ui.Get("/notifications/:id", handlers.ReadNotification())
ui.Get("/_api/notifications/unread", handlers.GetAllNotifications())
ui.Get("/change-email/verify", handlers.VerifyChangeEmailKey())

ui.Delete("/_api/user", handlers.DeleteUser())
Expand All @@ -148,7 +149,7 @@ func routes(r *web.Engine) *web.Engine {
ui.Get("/admin/authentication", handlers.ManageAuthentication())
ui.Get("/_api/admin/oauth/:provider", handlers.GetOAuthConfig())

//From this step, only Administrators are allowed
// From this step, only Administrators are allowed
ui.Use(middlewares.IsAuthorized(enum.RoleAdministrator))

ui.Get("/admin/export", handlers.Page("Export · Site Settings", "", "Administration/pages/Export.page"))
Expand Down

0 comments on commit 1003796

Please sign in to comment.