Skip to content

Commit

Permalink
Merge pull request #30 from ppolariss/main
Browse files Browse the repository at this point in the history
fix: async deleteJWTcredential when changing password
  • Loading branch information
JingYiJun authored Jan 14, 2025
2 parents 5771c34 + 9cb771f commit 55b2627
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions apis/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 55b2627

Please sign in to comment.