From 9cb771f32abfca7bfc8f0142b194d9b6617104be Mon Sep 17 00:00:00 2001 From: ppolariss <2673986789@qq.com> Date: Tue, 14 Jan 2025 21:29:49 +0800 Subject: [PATCH] fix: async deleteJWTcredential when changing password --- apis/account.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apis/account.go b/apis/account.go index 7be619c..98e68ab 100644 --- a/apis/account.go +++ b/apis/account.go @@ -393,10 +393,13 @@ func ChangePassword(c *fiber.Ctx) error { } if !config.Config.Standalone { - err = kong.DeleteJwtCredential(user.ID) - if err != nil { - return err - } + userID := user.ID + go func() { + err = kong.DeleteJwtCredential(userID) + if err != nil { + log.Warn().Err(err).Int("user_id", userID).Msg("failed to delete jwt credential") + } + }() } accessToken, refreshToken, err := user.CreateJWTToken()