ADD: card component and login behavior

This commit is contained in:
hwinkel
2025-12-16 23:14:40 +01:00
parent 435ad8e6e6
commit f4eb2efb33
16 changed files with 361 additions and 87 deletions

View File

@@ -24,6 +24,7 @@ func StartServer(cfg *config.Config) {
// Lokaler Fallback (wichtig für die Entwicklung)
allowedOrigins := []string{
"http://localhost:5173", // Gängiger Vite-Dev-Port
"http://127.0.0.1:5173",
}
if cfg.FrontendURL != "" {
@@ -50,11 +51,18 @@ func StartServer(cfg *config.Config) {
router.Use(cors.New(config))
router.POST("/login", func(c *gin.Context) {
auth.Login(c, db) // Pass the actual DB connection instead of nil
err := auth.Login(c, db)
if err != nil {
logger.Log.Error().Msg(err.Error())
}
})
router.POST("/register", func(c *gin.Context) {
auth.Register(c, db)
er := auth.Register(c, db)
if er != nil {
logger.Log.Error().Msg("register error")
}
})
router.Run(":" + cfg.Port)