🐛 Bug fixes on settings auth preferences

This commit is contained in:
LittleSheep 2024-10-13 14:07:49 +08:00
parent 68b4390edf
commit 06bd632f37
3 changed files with 7 additions and 7 deletions

8
.idea/workspace.xml generated
View File

@ -4,10 +4,10 @@
<option name="autoReloadType" value="ALL" /> <option name="autoReloadType" value="ALL" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":recycle: Improve notifications mark read system"> <list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Bug fixes on multi-factors based authentication">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/models/auth.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/models/auth.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/internal/models/auth.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/models/auth.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/services/ticket.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/services/ticket.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/pkg/internal/server/api/preferences_api.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/server/api/preferences_api.go" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -154,7 +154,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value=":bug: Fix compare perm node panic" />
<MESSAGE value=":bug: Fix compare perm node function" /> <MESSAGE value=":bug: Fix compare perm node function" />
<MESSAGE value=":sparkles: Bot related bot key apis" /> <MESSAGE value=":sparkles: Bot related bot key apis" />
<MESSAGE value=":bug: Fix bot related bot key apis path error" /> <MESSAGE value=":bug: Fix bot related bot key apis path error" />
@ -179,7 +178,8 @@
<MESSAGE value=":bug: Trying to prevent send same notification to the same user in batch" /> <MESSAGE value=":bug: Trying to prevent send same notification to the same user in batch" />
<MESSAGE value=":sparkles: Allow user view and remove notification subscriptions" /> <MESSAGE value=":sparkles: Allow user view and remove notification subscriptions" />
<MESSAGE value=":recycle: Improve notifications mark read system" /> <MESSAGE value=":recycle: Improve notifications mark read system" />
<option name="LAST_COMMIT_MESSAGE" value=":recycle: Improve notifications mark read system" /> <MESSAGE value=":bug: Bug fixes on multi-factors based authentication" />
<option name="LAST_COMMIT_MESSAGE" value=":bug: Bug fixes on multi-factors based authentication" />
</component> </component>
<component name="VgoProject"> <component name="VgoProject">
<settings-migrated>true</settings-migrated> <settings-migrated>true</settings-migrated>

View File

@ -8,7 +8,7 @@ import (
) )
type AuthConfig struct { type AuthConfig struct {
MaximumAuthSteps int `json:"maximum_auth_steps"` MaximumAuthSteps int `json:"maximum_auth_steps" validate:"required,min=1,max=99"`
} }
type AuthFactorType = int8 type AuthFactorType = int8

View File

@ -18,7 +18,7 @@ func getAuthPreference(c *fiber.Ctx) error {
return fiber.NewError(fiber.StatusNotFound, err.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 { func updateAuthPreference(c *fiber.Ctx) error {
@ -37,7 +37,7 @@ func updateAuthPreference(c *fiber.Ctx) error {
return fiber.NewError(fiber.StatusBadRequest, err.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 { func getNotificationPreference(c *fiber.Ctx) error {