diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index eb79f8f..05c9be3 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,10 +4,10 @@
-
+
-
+
@@ -154,7 +154,6 @@
-
@@ -179,7 +178,8 @@
-
+
+
true
diff --git a/pkg/internal/models/auth.go b/pkg/internal/models/auth.go
index c481eb4..898eeac 100644
--- a/pkg/internal/models/auth.go
+++ b/pkg/internal/models/auth.go
@@ -8,7 +8,7 @@ import (
)
type AuthConfig struct {
- MaximumAuthSteps int `json:"maximum_auth_steps"`
+ MaximumAuthSteps int `json:"maximum_auth_steps" validate:"required,min=1,max=99"`
}
type AuthFactorType = int8
diff --git a/pkg/internal/server/api/preferences_api.go b/pkg/internal/server/api/preferences_api.go
index 2d0164b..46b62db 100644
--- a/pkg/internal/server/api/preferences_api.go
+++ b/pkg/internal/server/api/preferences_api.go
@@ -18,7 +18,7 @@ func getAuthPreference(c *fiber.Ctx) error {
return fiber.NewError(fiber.StatusNotFound, err.Error())
}
- return c.JSON(cfg.Config)
+ return c.JSON(cfg.Config.Data())
}
func updateAuthPreference(c *fiber.Ctx) error {
@@ -37,7 +37,7 @@ func updateAuthPreference(c *fiber.Ctx) error {
return fiber.NewError(fiber.StatusBadRequest, err.Error())
}
- return c.JSON(cfg.Config)
+ return c.JSON(cfg.Config.Data())
}
func getNotificationPreference(c *fiber.Ctx) error {