fix webhook for deactiavtion
This commit is contained in:
parent
843bc022fe
commit
60de61a74e
|
@ -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`,
|
||||
|
|
|
@ -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},
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user