diff --git a/pkg/handler/app.go b/pkg/handler/app.go index 48858e90..b0bfb1d1 100644 --- a/pkg/handler/app.go +++ b/pkg/handler/app.go @@ -47,7 +47,7 @@ func Index(w http.ResponseWriter, r *http.Request) error { // Return an HTML form for the User to login. func Login(w http.ResponseWriter, r *http.Request) error { - var settings = database.SettingsMust() + var settings, _ = database.GetSettings() data := struct { Settings *Settings @@ -78,10 +78,13 @@ func Reset(w http.ResponseWriter, r *http.Request) error { // Return an HTML form for the User to signup. func SignUp(w http.ResponseWriter, r *http.Request) error { - if !database.SettingsMust().OpenInvitations { + var settings, _ = database.GetSettings() + + if settings == nil || !settings.OpenInvitations { http.Redirect(w, r, "/login", http.StatusSeeOther) return nil } + return RenderTemplate(w, "signup.html", nil) } diff --git a/pkg/template/pages/login.html b/pkg/template/pages/login.html index 49d668b2..8c383b04 100644 --- a/pkg/template/pages/login.html +++ b/pkg/template/pages/login.html @@ -10,8 +10,8 @@
- {{ if .Settings.OpenInvitations }} - request invitation  + {{ if .Settings ne nil and .Settings.OpenInvitations }} + request invitation ยท  {{ end }} forgot password