diff --git a/server/resolvers/deactivate_account.go b/server/resolvers/deactivate_account.go index 6248792..e6f7be9 100644 --- a/server/resolvers/deactivate_account.go +++ b/server/resolvers/deactivate_account.go @@ -49,7 +49,7 @@ func DeactivateAccountResolver(ctx context.Context) (*model.Response, error) { } go func() { memorystore.Provider.DeleteAllUserSessions(user.ID) - utils.RegisterEvent(ctx, constants.UserAccessRevokedWebhookEvent, "", user) + utils.RegisterEvent(ctx, constants.UserDeactivatedWebhookEvent, "", user) }() res = &model.Response{ Message: `user account deactivated successfully`, diff --git a/server/test/test.go b/server/test/test.go index 217ad39..524aeb4 100644 --- a/server/test/test.go +++ b/server/test/test.go @@ -103,7 +103,7 @@ func testSetup() TestSetup { Email: fmt.Sprintf("%d_authorizer_tester@yopmail.com", time.Now().Unix()), Password: "Test@123", WebhookEndpoint: "https://62f93101e05644803533cf36.mockapi.io/authorizer/webhook", - TestWebhookEventTypes: []string{constants.UserAccessEnabledWebhookEvent, constants.UserAccessRevokedWebhookEvent, constants.UserCreatedWebhookEvent, constants.UserDeletedWebhookEvent, constants.UserLoginWebhookEvent, constants.UserSignUpWebhookEvent}, + TestWebhookEventTypes: []string{constants.UserAccessEnabledWebhookEvent, constants.UserAccessRevokedWebhookEvent, constants.UserCreatedWebhookEvent, constants.UserDeletedWebhookEvent, constants.UserLoginWebhookEvent, constants.UserSignUpWebhookEvent, constants.UserDeactivatedWebhookEvent}, TestEmailTemplateEventTypes: []string{constants.VerificationTypeBasicAuthSignup, constants.VerificationTypeForgotPassword, constants.VerificationTypeMagicLinkLogin, constants.VerificationTypeUpdateEmail}, } diff --git a/server/validators/webhook.go b/server/validators/webhook.go index 1309cad..eb2476b 100644 --- a/server/validators/webhook.go +++ b/server/validators/webhook.go @@ -4,7 +4,7 @@ import "github.com/authorizerdev/authorizer/server/constants" // IsValidWebhookEventName to validate webhook event name func IsValidWebhookEventName(eventName string) bool { - if eventName != constants.UserCreatedWebhookEvent && eventName != constants.UserLoginWebhookEvent && eventName != constants.UserSignUpWebhookEvent && eventName != constants.UserDeletedWebhookEvent && eventName != constants.UserAccessEnabledWebhookEvent && eventName != constants.UserAccessRevokedWebhookEvent { + if eventName != constants.UserCreatedWebhookEvent && eventName != constants.UserLoginWebhookEvent && eventName != constants.UserSignUpWebhookEvent && eventName != constants.UserDeletedWebhookEvent && eventName != constants.UserAccessEnabledWebhookEvent && eventName != constants.UserAccessRevokedWebhookEvent && eventName != constants.UserDeactivatedWebhookEvent { return false }