csrf protection

This commit is contained in:
2021-04-10 19:27:15 +02:00
parent ed48629a61
commit 66ef9e6d0c
9 changed files with 40 additions and 25 deletions

View File

@ -18,7 +18,7 @@ func accountApi(w http.ResponseWriter, r *http.Request) {
var account accountApiResponse
var success bool
var usernameInter interface{}
usernameInter, success = sessions.GetStringKey(accountKey)
usernameInter, success = sessions.Load(accountKey)
account.Username = usernameInter.(string)
if !success {
http.Error(w, "Error 400 invalid session", 400)