From fdfeafa1ecaddf0b017c7d4bbd96e868f2620403 Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Tue, 9 Feb 2016 22:19:06 -0600 Subject: [PATCH] Restricted registration to only logged in users. Fixes #137 --- controllers/route.go | 2 +- templates/login.html | 1 - templates/settings.html | 9 ++++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/controllers/route.go b/controllers/route.go index 6f2e2dae..22c163af 100644 --- a/controllers/route.go +++ b/controllers/route.go @@ -35,7 +35,7 @@ func CreateAdminRouter() http.Handler { router.HandleFunc("/templates", Use(Templates, mid.RequireLogin)) router.HandleFunc("/users", Use(Users, mid.RequireLogin)) router.HandleFunc("/landing_pages", Use(LandingPages, mid.RequireLogin)) - router.HandleFunc("/register", Register) + router.HandleFunc("/register", Use(Register, mid.RequireLogin)) router.HandleFunc("/settings", Use(Settings, mid.RequireLogin)) // Create the API routes api := router.PathPrefix("/api").Subrouter() diff --git a/templates/login.html b/templates/login.html index c7040ea3..124ae407 100644 --- a/templates/login.html +++ b/templates/login.html @@ -56,7 +56,6 @@ - Create new account diff --git a/templates/settings.html b/templates/settings.html index 91735d4a..29e7e802 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -26,6 +26,13 @@

Settings

+
+ + +
+
@@ -60,7 +67,7 @@

- +