Files
kontor/kontor-gin/internal/handlers/auth.go
T
tpeetz 2d6fa7b7ee
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
add rest client
2026-09-27 03:09:22 +02:00

24 lines
477 B
Go

package handlers
import (
"kontor-api-gin/internal/helpers"
"kontor-api-gin/internal/service"
"net/http"
"github.com/gin-contrib/slog"
"github.com/gin-gonic/gin"
)
type AuthHandler struct {
Service *service.AuthService
}
func (handler *AuthHandler) Login(c *gin.Context) {
token, err := helpers.GenerateToken("bla")
logger := slog.Get(c)
if err != nil {
logger.Info("Login", "GenerateToken error", err.Error())
}
c.JSON(http.StatusOK, gin.H{"token": token})
}