Compare commits
3 Commits
v1.0.1
...
a2077131a7
Author | SHA1 | Date | |
---|---|---|---|
a2077131a7 | |||
edccb95be3 | |||
9e4216301d |
@ -2,7 +2,7 @@ package controllers
|
||||
|
||||
import (
|
||||
"GoWeb/app"
|
||||
"GoWeb/database/models"
|
||||
"GoWeb/models"
|
||||
"GoWeb/security"
|
||||
"GoWeb/templating"
|
||||
"net/http"
|
||||
|
@ -2,7 +2,7 @@ package controllers
|
||||
|
||||
import (
|
||||
"GoWeb/app"
|
||||
"GoWeb/database/models"
|
||||
"GoWeb/models"
|
||||
"GoWeb/security"
|
||||
"log"
|
||||
"net/http"
|
||||
|
2
go.mod
2
go.mod
@ -4,5 +4,5 @@ go 1.20
|
||||
|
||||
require (
|
||||
github.com/lib/pq v1.10.7
|
||||
golang.org/x/crypto v0.1.0
|
||||
golang.org/x/crypto v0.6.0
|
||||
)
|
||||
|
4
go.sum
4
go.sum
@ -1,4 +1,4 @@
|
||||
github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
|
||||
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
|
||||
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
||||
golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
|
||||
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
|
||||
|
@ -148,8 +148,7 @@ func createSessionCookie(app *app.App, w http.ResponseWriter, username string) (
|
||||
}
|
||||
|
||||
// Store token in auth_token column of the users table
|
||||
sqlStatement := "UPDATE users SET auth_token = $1 WHERE username = $2"
|
||||
_, err = app.Db.Exec(sqlStatement, token, username)
|
||||
_, err = app.Db.Exec("UPDATE users SET auth_token = $1 WHERE username = $2", token, username)
|
||||
if err != nil {
|
||||
log.Println("Error setting auth_token column in users table")
|
||||
log.Println(err)
|
Reference in New Issue
Block a user