From 31139e943f18ea600593c3f2ae223ed038a4e065 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 22 May 2024 22:51:30 +0800 Subject: [PATCH] :bug: Fix set banner after avatar reset avatar settings --- pkg/server/avatar_api.go | 6 ++++++ settings.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/server/avatar_api.go b/pkg/server/avatar_api.go index ffccde0..cffb5cc 100644 --- a/pkg/server/avatar_api.go +++ b/pkg/server/avatar_api.go @@ -3,10 +3,12 @@ package server import ( "context" "fmt" + pcpb "git.solsynth.dev/hydrogen/paperclip/pkg/grpc/proto" "git.solsynth.dev/hydrogen/passport/pkg/database" "git.solsynth.dev/hydrogen/passport/pkg/grpc" "git.solsynth.dev/hydrogen/passport/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/services" "git.solsynth.dev/hydrogen/passport/pkg/utils" "github.com/gofiber/fiber/v2" "github.com/samber/lo" @@ -34,6 +36,8 @@ func setAvatar(c *fiber.Ctx) error { if err := database.C.Save(&user).Error; err != nil { return fiber.NewError(fiber.StatusInternalServerError, err.Error()) + } else { + services.InvalidAuthCacheWithUser(user.ID) } return c.SendStatus(fiber.StatusOK) @@ -61,6 +65,8 @@ func setBanner(c *fiber.Ctx) error { if err := database.C.Save(&user).Error; err != nil { return fiber.NewError(fiber.StatusInternalServerError, err.Error()) + } else { + services.InvalidAuthCacheWithUser(user.ID) } return c.SendStatus(fiber.StatusOK) diff --git a/settings.toml b/settings.toml index b79c854..9ba3c8e 100644 --- a/settings.toml +++ b/settings.toml @@ -41,4 +41,4 @@ prefix = "passport_" CreatePaperclipAttachments = 1048576 [permissions.verified] -CreatePaperclipAttachments = 26214400 \ No newline at end of file +CreatePaperclipAttachments = 26214400