From ae39f02812bcfe903e956220c890bfb7b9bb9ff4 Mon Sep 17 00:00:00 2001 From: Emile Date: Wed, 19 Feb 2025 19:53:25 +0100 Subject: removed the backend, added the frontend with oidc support So I've added oidc support which is nice, yet I have to test this with some https foo, so I'm pushing this. --- nix/templates/goapp/frontend/db.go | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 nix/templates/goapp/frontend/db.go (limited to 'nix/templates/goapp/frontend/db.go') diff --git a/nix/templates/goapp/frontend/db.go b/nix/templates/goapp/frontend/db.go deleted file mode 100644 index fd3605a..0000000 --- a/nix/templates/goapp/frontend/db.go +++ /dev/null @@ -1,37 +0,0 @@ -package main - -import ( - "database/sql" - "log" - - _ "github.com/mattn/go-sqlite3" -) - -const create string = ` -CREATE TABLE IF NOT EXISTS users ( - id INTEGER NOT NULL PRIMARY KEY, - created_at DATETIME NOT NULL, - name TEXT, - passwordHash TEXT -); -` - -type State struct { - db *sql.DB // the database storing the "business data" - sessions *SqliteStore // the database storing sessions -} - -func NewState() (*State, error) { - db, err := sql.Open("sqlite3", databasePath) - if err != nil { - log.Println("Error opening the db: ", err) - return nil, err - } - if _, err := db.Exec(create); err != nil { - log.Println("Error creating the tables: ", err) - return nil, err - } - return &State{ - db: db, - }, nil -} -- cgit 1.4.1