func (br *BeuboRouter) Register(w http.ResponseWriter, r *http.Request) {
	setting := structs.FetchSettingByKey(br.DB, "enable_user_registration")
	if setting.ID == 0 || setting.Value == "false" {
		http.Redirect(w, r, "/login", 302)
		return
	}
	pageData := structs.PageData{
		Template: "register",
		Title:    "Register",
	}
	br.Renderer.RenderHTMLPage(w, r, pageData)
}
Register renders the default registration page
package routes
import (
	sessions "github.com/goincremental/negroni-sessions"
	"github.com/uberswe/beubo/pkg/structs"
	"github.com/uberswe/beubo/pkg/utility"
	"net/http"
)
func (br *BeuboRouter) Login(w http.ResponseWriter, r *http.Request) {
	pageData := structs.PageData{
		Template: "login",
		Title:    "Login",
	}
	br.Renderer.RenderHTMLPage(w, r, pageData)
}
func (br *BeuboRouter) LoginPost(w http.ResponseWriter, r *http.Request) {
	session := sessions.GetSession(r)
	invalidError := "Email or password incorrect, please try again or contact support"
	email := r.FormValue("email")
	password := r.FormValue("password")
	user := structs.AuthUser(br.DB, email, password)
	if user == nil || user.ID == 0 {
		utility.SetFlash(w, "error", []byte(invalidError))
		http.Redirect(w, r, "/login", 302)
		return
	}
	ses := structs.CreateSession(br.DB, int(user.ID))
	if ses.ID == 0 {
		w.WriteHeader(http.StatusInternalServerError)
		_, _ = w.Write([]byte("500 - Could not create session"))
		return
	}
	session.Set("SES_ID", ses.Token)
	http.Redirect(w, r, "/admin/", 302)
}