Upgraded to the latest go-web-kit.

This commit is contained in:
Zed A. Shaw 2025-11-03 14:09:57 -05:00
parent 051474bdc9
commit 41f31a621f
14 changed files with 124 additions and 142 deletions

View file

@ -11,11 +11,9 @@ import (
"MY/webapp/data"
. "MY/webapp/common"
"MY/webapp/auth"
)
var STORE *session.Store
func GetApiStream(c *fiber.Ctx) error {
sql, args, err := sq.Select("*").From("stream").ToSql()
err = data.SelectJson[data.Stream](c, err, sql, args...)
@ -45,7 +43,7 @@ func PostApiLink(c *fiber.Ctx) error {
var sql string
var args []interface{}
_, err := CheckAuthed(c, false)
_, err := auth.Check(c, false)
if err != nil { return c.Redirect("/login/") }
link, err := ReceivePost[data.Link](c)
@ -95,12 +93,6 @@ func Setup(app *fiber.App) {
app.Get("/api/stream/:id", GetApiStreamId)
app.Get("/api/stream/:id/links", GetApiStreamIdLinks)
app.Post("/api/link", PostApiLink)
// api/auth.go
app.Get("/api/authcheck", GetApiAuthCheck)
app.Get("/api/logout", GetApiLogout)
app.Post("/api/register", PostApiRegister)
app.Post("/api/login", PostApiLogin)
}
func Shutdown() {