{"record":{"id":"f35c3c9c34eed4c7","repo":"SigNoz/signoz","slug":"errcoderesetpasswordtokenexpired","errorCode":"ErrCodeResetPasswordTokenExpired","errorMessage":"reset password token has expired","messagePattern":"reset password token has expired","errorType":"error_code","errorClass":"errors.Error","httpStatus":401,"severity":"error","filePath":"pkg/modules/user/impluser/getter.go","lineNumber":145,"sourceCode":"\treturn module.userRoleStore.GetUserRoleByOrgIDAndID(ctx, orgID, id)\n}\n\nfunc (module *getter) GetResetPasswordTokenByOrgIDAndUserID(ctx context.Context, orgID valuer.UUID, userID valuer.UUID) (*types.ResetPasswordToken, error) {\n\treturn module.store.GetResetPasswordTokenByOrgIDAndUserID(ctx, orgID, userID)\n}\n\nfunc (module *getter) GetUsersByOrgIDAndRoleID(ctx context.Context, orgID valuer.UUID, roleID valuer.UUID) ([]*types.User, error) {\n\treturn module.store.GetUsersByOrgIDAndRoleID(ctx, orgID, roleID)\n}\n\nfunc (module *getter) VerifyResetPasswordToken(ctx context.Context, token string) error {\n\tresetPasswordToken, err := module.store.GetResetPasswordToken(ctx, token)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif resetPasswordToken.IsExpired() {\n\t\treturn errors.New(errors.TypeUnauthenticated, types.ErrCodeResetPasswordTokenExpired, \"reset password token has expired\")\n\t}\n\n\treturn nil\n}\n\nfunc (module *getter) OnBeforeRoleDelete(ctx context.Context, orgID valuer.UUID, roleID valuer.UUID, _ string) error {\n\tusers, err := module.GetUsersByOrgIDAndRoleID(ctx, orgID, roleID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(users) > 0 {\n\t\treturn errors.New(errors.TypeInvalidInput, authtypes.ErrCodeRoleHasUserAssignees, \"role has active user assignments, remove them before deleting\")\n\t}\n\treturn nil\n}\n","sourceCodeStart":127,"sourceCodeEnd":161,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/modules/user/impluser/getter.go#L127-L161","documentation":"The supplied password-reset token exists in the store but its expiration timestamp has passed. Returned as TypeUnauthenticated from VerifyResetPasswordToken when resetPasswordToken.IsExpired() is true.","triggerScenarios":"Calling the verify-reset-password-token endpoint (or ResetPassword flow) with a token older than the configured TTL; reusing a token from an old email after it expired.","commonSituations":"User waits too long before clicking the reset link; token was generated by an older deployment with different TTL; clock skew between services.","solutions":["Request a new password reset token (restart the forgot-password flow)","Check/increase the reset token TTL configuration if users routinely exceed it","Ensure server clocks are in sync (NTP) so tokens don't appear expired prematurely"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := verifyResetPasswordToken(ctx, token)\nif err != nil && errors.Ast(err, errors.TypeUnauthenticated) && strings.Contains(err.Error(), \"expired\") {\n    // prompt user to request a new reset email\n}","preventionTips":["Start the reset flow only when the user is ready to complete it","Handle 401-on-verify by transparently re-issuing a forgot-password request"],"tags":["auth","token-expired","password-reset","user-module"],"backgroundTag":"token-expired","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}