Files
triggerssmith/api/auth/handle.go

38 lines
942 B
Go

// Package auth provides authentication-related API endpoints for the Triggersmith application.
// It handles login, logout, and user management operations.
package auth
import (
"net/http"
"git.oblat.lv/alex/triggerssmith/internal/config"
"github.com/go-chi/chi/v5"
)
type authHandler struct {
cfg *config.Config
}
func MustRoute(config *config.Config) func(chi.Router) {
if config == nil {
panic("config is nil")
}
h := &authHandler{
cfg: config,
}
return func(r chi.Router) {
r.Get("/login", h.handleLogin)
r.Get("/logout", h.handleLogout)
r.Get("/me", h.handleMe)
r.Get("/revoke", h.handleRevoke)
}
}
func (h *authHandler) handleLogin(w http.ResponseWriter, r *http.Request) {}
func (h *authHandler) handleLogout(w http.ResponseWriter, r *http.Request) {}
func (h *authHandler) handleMe(w http.ResponseWriter, r *http.Request) {}
func (h *authHandler) handleRevoke(w http.ResponseWriter, r *http.Request) {}