Replace CDN-hosted datastar beta.11 with local v1.0.0-RC.7 to fix client-side expression incompatibilities with the Go SDK. Also fix quoted CSS class keys in data-class expressions, harden session cookie settings (named cookie, Secure flag), simplify SetupRoutes to not return an error, and regenerate templ output.
17 lines
510 B
Go
17 lines
510 B
Go
// Package auth handles user authentication routes and handlers.
|
|
package auth
|
|
|
|
import (
|
|
"github.com/alexedwards/scs/v2"
|
|
"github.com/go-chi/chi/v5"
|
|
|
|
"github.com/ryanhamamura/c4/db/repository"
|
|
)
|
|
|
|
func SetupRoutes(router chi.Router, queries *repository.Queries, sessions *scs.SessionManager) {
|
|
router.Get("/login", HandleLoginPage())
|
|
router.Get("/register", HandleRegisterPage())
|
|
router.Post("/auth/login", HandleLogin(queries, sessions))
|
|
router.Post("/auth/register", HandleRegister(queries, sessions))
|
|
}
|