Skip to content

Commit 9cb771f

Browse files
committed
fix: async deleteJWTcredential when changing password
1 parent 5771c34 commit 9cb771f

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

apis/account.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,13 @@ func ChangePassword(c *fiber.Ctx) error {
393393
}
394394

395395
if !config.Config.Standalone {
396-
err = kong.DeleteJwtCredential(user.ID)
397-
if err != nil {
398-
return err
399-
}
396+
userID := user.ID
397+
go func() {
398+
err = kong.DeleteJwtCredential(userID)
399+
if err != nil {
400+
log.Warn().Err(err).Int("user_id", userID).Msg("failed to delete jwt credential")
401+
}
402+
}()
400403
}
401404

402405
accessToken, refreshToken, err := user.CreateJWTToken()

0 commit comments

Comments
 (0)