Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix(user): revoke sessions on password reset (#12531)

Vikrant Guptafaaed20dbd08
diff --git a/pkg/modules/user/impluser/setter.go b/pkg/modules/user/impluser/setter.go
index 214b2e9020..dcd3af0dde 100644
--- a/pkg/modules/user/impluser/setter.go
+++ b/pkg/modules/user/impluser/setter.go
@@ -444,7 +444,7 @@ func (module *setter) UpdatePasswordByResetPasswordToken(ctx context.Context, to
module.analytics.TrackUser(ctx, user.OrgID.String(), user.ID.String(), "User Activated", traitsOrProperties)
}
- return module.store.RunInTx(ctx, func(ctx context.Context) error {
+ if err := module.store.RunInTx(ctx, func(ctx context.Context) error {
if isPendingInviteUser {
err := module.store.UpdateUser(ctx, user.OrgID, user)
if err != nil {
@@ -461,7 +461,11 @@ func (module *setter) UpdatePasswordByResetPasswordToken(ctx context.Context, to
}
return nil
- })
+ }); err != nil {
+ return err
+ }
+
+ return module.tokenizer.DeleteTokensByUserID(ctx, user.ID)
}
func (module *setter) UpdatePassword(ctx context.Context, userID valuer.UUID, oldpasswd string, passwd string) error {