Esempio n. 1
0
func UserHandler(w http.ResponseWriter, r *http.Request) {

	session, _ := app.GlobalSessions.SessionStart(w, r)
	defer session.SessionRelease(w)

	templates.RenderTemplate(w, "user", session.Get("profile"))
}
Esempio n. 2
0
func HomeHandler(w http.ResponseWriter, r *http.Request) {

	data := struct {
		Auth0ClientId     string
		Auth0ClientSecret string
		Auth0Domain       string
		Auth0CallbackURL  template.URL
	}{
		os.Getenv("AUTH0_CLIENT_ID"),
		os.Getenv("AUTH0_CLIENT_SECRET"),
		os.Getenv("AUTH0_DOMAIN"),
		template.URL(os.Getenv("AUTH0_CALLBACK_URL")),
	}

	templates.RenderTemplate(w, "home", data)
}