Skip to content

Commit 60de61a

Browse files
committed
fix webhook for deactiavtion
1 parent 843bc02 commit 60de61a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

server/resolvers/deactivate_account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func DeactivateAccountResolver(ctx context.Context) (*model.Response, error) {
4949
}
5050
go func() {
5151
memorystore.Provider.DeleteAllUserSessions(user.ID)
52-
utils.RegisterEvent(ctx, constants.UserAccessRevokedWebhookEvent, "", user)
52+
utils.RegisterEvent(ctx, constants.UserDeactivatedWebhookEvent, "", user)
5353
}()
5454
res = &model.Response{
5555
Message: `user account deactivated successfully`,

server/test/test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func testSetup() TestSetup {
103103
Email: fmt.Sprintf("%[email protected]", time.Now().Unix()),
104104
Password: "Test@123",
105105
WebhookEndpoint: "https://62f93101e05644803533cf36.mockapi.io/authorizer/webhook",
106-
TestWebhookEventTypes: []string{constants.UserAccessEnabledWebhookEvent, constants.UserAccessRevokedWebhookEvent, constants.UserCreatedWebhookEvent, constants.UserDeletedWebhookEvent, constants.UserLoginWebhookEvent, constants.UserSignUpWebhookEvent},
106+
TestWebhookEventTypes: []string{constants.UserAccessEnabledWebhookEvent, constants.UserAccessRevokedWebhookEvent, constants.UserCreatedWebhookEvent, constants.UserDeletedWebhookEvent, constants.UserLoginWebhookEvent, constants.UserSignUpWebhookEvent, constants.UserDeactivatedWebhookEvent},
107107
TestEmailTemplateEventTypes: []string{constants.VerificationTypeBasicAuthSignup, constants.VerificationTypeForgotPassword, constants.VerificationTypeMagicLinkLogin, constants.VerificationTypeUpdateEmail},
108108
}
109109

server/validators/webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "github.com/authorizerdev/authorizer/server/constants"
44

55
// IsValidWebhookEventName to validate webhook event name
66
func IsValidWebhookEventName(eventName string) bool {
7-
if eventName != constants.UserCreatedWebhookEvent && eventName != constants.UserLoginWebhookEvent && eventName != constants.UserSignUpWebhookEvent && eventName != constants.UserDeletedWebhookEvent && eventName != constants.UserAccessEnabledWebhookEvent && eventName != constants.UserAccessRevokedWebhookEvent {
7+
if eventName != constants.UserCreatedWebhookEvent && eventName != constants.UserLoginWebhookEvent && eventName != constants.UserSignUpWebhookEvent && eventName != constants.UserDeletedWebhookEvent && eventName != constants.UserAccessEnabledWebhookEvent && eventName != constants.UserAccessRevokedWebhookEvent && eventName != constants.UserDeactivatedWebhookEvent {
88
return false
99
}
1010

0 commit comments

Comments
 (0)