Retry Hook if my own API server failed

Is there a way to ensure a hook runs successfully and keep on retrying? We are trying to sync Auth0 DB users to our legacy DB as we are integrating Auth0 and we want our pre existing features to be back ward compatible with when a user is created through Auth0 vs our legacy system.

So my thought is to send the authenthication event results from two ways:

  1. Through client from using Lock on event “on authentication” to our own endpoint
  2. Have Auth0 handle it through hooks

I don’t know a good way for us to approach this on ensuring that the database is synced at all times. Any suggestions?

Thanks,

Hi @mdere,

Welcome to the Community!

As hooks run in a sequence from top to down and there is not any way to re run hook in same cycle. What i suggest to you is that you write your logic in hook in some kind of loop to retry when your required condition doesn’t meet or you can write two hooks to give another try to sync your DB.

Please let us know if it helps.

@rashid779939 - are we able to just rollback the created user in the post registration - if so can you provide a quick code snippet on how to achieve that in the hook?

Also I am having difficulty getting a full context on what we can do inside a hook - are there more hook examples of specific scenarios?

Touching base on this topic @mdere and I wanted to find out if you are still running into a challenge with this? Also are you accounting for rate limiting with your implementation? I would love to find out more about the situation and how I can be of service. Thanks!

I think I am good now.

1 Like

Perfect! Glad to hear that!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.