Removed debug prints
This commit is contained in:
3
main.go
3
main.go
@@ -2,7 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
_ "github.com/mattn/go-sqlite3"
|
_ "github.com/mattn/go-sqlite3"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -54,12 +53,10 @@ func login(c *gin.Context) {
|
|||||||
checkErr(err)
|
checkErr(err)
|
||||||
defer stmt.Close()
|
defer stmt.Close()
|
||||||
var user loginOutput
|
var user loginOutput
|
||||||
fmt.Printf("%s", userData.Name)
|
|
||||||
err = stmt.QueryRow(userData.Name).Scan(&user.Name, &user.Password, &user.UID, &user.Role)
|
err = stmt.QueryRow(userData.Name).Scan(&user.Name, &user.Password, &user.UID, &user.Role)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// search failed user not real
|
// search failed user not real
|
||||||
c.IndentedJSON(http.StatusNotAcceptable, userData)
|
c.IndentedJSON(http.StatusNotAcceptable, userData)
|
||||||
fmt.Print(err)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if user.Password != userData.Password {
|
if user.Password != userData.Password {
|
||||||
|
|||||||
Reference in New Issue
Block a user