webhook problem
-
Here is what I am trying. Please let me know if this is a reasonable way to go? I am using passwordless login. When the user gets the email they click on the link and it works fine. Let's say a few hours later they decide to click on the link again. At this point I would like to catch them and send them to my own error page "your login has expired!".
So I am trying to do this with a webhook by trying to get triggered on user.login.failed. But for some reason it doesn't seem to get to my "login expired" page.
Under Edit/webhook/settings/webhooks/applications i have set it to just my application.
Can you tell me a path to debug this problem?
-
There is no way to redirect a user anywhere via webhook. Webhooks requests are made internally by the FA and only FA receives its response.
Use FreeMarker templates to tailor the default page shown by the FA on such event to your needs. If for some reason it is really necessary to redirect a user somewhere else you can edit the page to initiate the redirect via HTML
meta
tags or javascript. -
One thing you could do is send them an email with a fresh login link. You could catch the 'login failed' and generate a new magic link (which you could build via the API). Then you'd send them an email with the new magic link.
You could also make sure you include when the link expires in the subject line of the email.
More on doing that here: https://fusionauth.io/community/forum/topic/220/can-i-customize-the-passwordless-link-email-subject-with-the-time-the-link-expires