diff options
| author | Nikolaus Gotsche <n@softwarefools.com> | 2017-09-25 22:37:21 +0200 |
|---|---|---|
| committer | Nikolaus Gotsche <n@softwarefools.com> | 2017-09-25 22:37:21 +0200 |
| commit | 4a0b4a5c406e3b9da7d4f10d14ec87c3c173a4db (patch) | |
| tree | cc127110d36b39783a72b945f0512f296e675ddf | |
| parent | 931fdd01358989f6ab73e29c949449e9639d005b (diff) | |
backend output
| -rw-r--r-- | signup.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -6,7 +6,7 @@ import _ "github.com/go-sql-driver/mysql" import "golang.org/x/crypto/bcrypt" import "net/http" - +import "fmt" import "os/exec" var db *sql.DB @@ -41,9 +41,11 @@ func signupPage(res http.ResponseWriter, req *http.Request) { _, err = db.Exec("INSERT INTO players(username, password, uuid) VALUES(?, ?, ?)", username, hashedPassword, newuuid) if err != nil { http.Error(res, "Server Error Inserting User. Unable to create account! You Fool...", 500) + fmt.Println("Error adding User",username) return } res.Write([]byte("User Created Successfully!")) + fmt.Println("Successfully Created User",username,newuuid) return case err != nil: http.Error(res, "Server Error! Something fucked up", 500) @@ -70,16 +72,19 @@ func loginPage(res http.ResponseWriter, req *http.Request) { if err != nil { http.Redirect(res, req, "/login", 301) + fmt.Println("Failed Login atempt by",username) return } err = bcrypt.CompareHashAndPassword([]byte(databasePassword), []byte(password)) if err != nil { http.Redirect(res, req, "/login", 301) + fmt.Println(username," used wrong Password ",password) return } res.Write([]byte("Hello "+ databaseUsername + "! Your UUID is "+ databaseUUID)) + fmt.Println("Successful Login by",username) } func homePage(res http.ResponseWriter, req *http.Request) { |
