feat(security): #286 implement csrf middleware
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"me-fit/db"
|
||||
"me-fit/log"
|
||||
"me-fit/service"
|
||||
"me-fit/types"
|
||||
@@ -34,7 +33,7 @@ func TestHandleSignIn(t *testing.T) {
|
||||
|
||||
pass := service.GetHashPassword("password", []byte("salt"))
|
||||
_, err := db.Exec(`
|
||||
INSERT INTO user (user_uuid, email, email_verified, is_admin, password, salt, created_at)
|
||||
INSERT INTO user (user_id, email, email_verified, is_admin, password, salt, created_at)
|
||||
VALUES (?, "mail@mail.de", FALSE, FALSE, ?, ?, datetime())`, uuid.New(), pass, []byte("salt"))
|
||||
if err != nil {
|
||||
t.Fatalf("Error inserting user: %v", err)
|
||||
@@ -91,11 +90,6 @@ func setupIntegrationTest(t *testing.T, port string) (*sql.DB, context.Context)
|
||||
database.Close()
|
||||
})
|
||||
|
||||
err = db.RunMigrations(database, "")
|
||||
if err != nil {
|
||||
t.Fatalf("Could not run migrations: %v", err)
|
||||
}
|
||||
|
||||
go run(ctx, database, getEnv(port))
|
||||
|
||||
err = waitForReady(ctx, 5*time.Second, "http://localhost:8080")
|
||||
|
||||
Reference in New Issue
Block a user