ADD: card component and login behavior
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user