about summary refs log tree commit diff
path: root/src/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/http.go')
-rw-r--r--src/http.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/http.go b/src/http.go
index 5263062..9632787 100644
--- a/src/http.go
+++ b/src/http.go
@@ -8,6 +8,7 @@ import (
 	"io/ioutil"
 	"log"
 	"net/http"
+	"os"
 	"strings"
 
 	"github.com/gorilla/mux"
@@ -22,6 +23,7 @@ var (
 type Credentials struct {
 	Username   string
 	Accesscode string
+	Hostname   string
 }
 
 func registerHTTPFlags() {
@@ -89,9 +91,6 @@ func registerPostHandler(w http.ResponseWriter, r *http.Request) {
 	r.Form["accesscode"] = []string{accesscodeBase64}
 
 	credentialsGetHandler(w, r)
-	//log.Println("redirecting to /credentials")
-	//endpoint := fmt.Sprintf("/credentials?username=%s&accesscode=%s", usernameBase64, accesscodeBase64)
-	//http.Redirect(w, r, endpoint, http.StatusSeeOther)
 }
 
 func usernameTakenGetHandler(w http.ResponseWriter, r *http.Request) {
@@ -152,6 +151,7 @@ func credentialsGetHandler(w http.ResponseWriter, r *http.Request) {
 	creds := Credentials{
 		Username:   string(username),
 		Accesscode: string(accesscode),
+		Hostname:   string(os.Getenv("HOSTNAME")),
 	}
 	log.Println("executing the template")
 	t.ExecuteTemplate(w, "credentials", creds)