diff options
Diffstat (limited to 'signup.go')
| -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) { |
