# \[Magic Link Help\] Logs when a user enters an error page

**URL:** <https://forum.bubble.io/t/magic-link-help-logs-when-a-user-enters-an-error-page/286997>\
**Category:** Need help\
**Created:** [October 6, 2023, 5:20pm UTC](https://forum.bubble.io/t/magic-link-help-logs-when-a-user-enters-an-error-page/286997 "2023-10-06T17:20:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramiro](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@ramiro](https://forum.bubble.io/u/ramiro)\
**Post date:** [October 6, 2023, 5:20pm UTC](https://forum.bubble.io/t/magic-link-help-logs-when-a-user-enters-an-error-page/286997/1 "2023-10-06T17:20:45Z")

</div>

Hi everybody!

I’m using a ‘send magic link’ action in my app that redirects a user to an error page on error and a confirmation page on success, today when looking at my logs, i see that a lot of people are navigating my error page, and the only ways to reach this are: 1) having the link and entering it (extremely rare) 2) Using a faulty link, with an incorrect confirmation uuid (it seems odd to happen, but can be possible) 3) Passing more time than the confirmation time provided (possible).

Is there any way to debug this issue, like what is the URL the user is entering the browser to access this page? Example: USER A = [mypage.com/error?confirmation=faultyID](http://mypage.com/error?confirmation=faultyID). Or specifically to know the causes of when my users are being taken to this page?

I tried with the logs but i couldn’t find a way to know tje request the user is doing when accessing my page or the faulty magic links redirection.  
I tried with the ‘HTTP Request’ and ‘HTTP Response’ filters in logs, but i’m only getting the flows from Sendgrid when sending an email.

All the ‘Magic Link’ Action behind scenes seems to be around shadows, is there any deeper explanation of what happens internally, how it communicates with Bubble’s Auth API and how does the Sendgrid encoded URL works? There are a lot of questions unanswered in the official announcement also @sam8@grace.hong

> [@\[New Feature\] Magic login link workflow action](http://forum.bubble.io/t/new-feature-magic-login-link-workflow-action/164532/73):
>
> We have received multiple cases of an expired link being received by users. The user receives the email fine but when they click it, they see This link is expired or has already been used. Please request another. Our suspicion is corporate firewalls and spam checkers. But I thought I’d flag this again as this probably needs some fixing, please. Thanks ZubairLK

This is a possible issue, but it’s a hacky solution and not ideal, also i cannot find a way to debug if the links are being faulty or it’s another reason.

Thank you!

---

<div class="post-metadata">

**Author:** ![ramiro](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@ramiro](https://forum.bubble.io/u/ramiro)\
**Post date:** [October 15, 2023, 11:28pm UTC](https://forum.bubble.io/t/magic-link-help-logs-when-a-user-enters-an-error-page/286997/2 "2023-10-15T23:28:34Z")

</div>

bump.

---

<div class="post-metadata">

**Author:** ![tylerboodman](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/tylerboodman/32/242142_2.png) [@tylerboodman](https://forum.bubble.io/u/tylerboodman)\
**Post date:** [October 16, 2023, 2:17am UTC](https://forum.bubble.io/t/magic-link-help-logs-when-a-user-enters-an-error-page/286997/3 "2023-10-16T02:17:27Z")

</div>

Don’t know anything about being able to debug this, but have you tried this? [[New Feature] Magic login link workflow action - #76 by jared8](http://forum.bubble.io/t/new-feature-magic-login-link-workflow-action/164532/76)

Maybe the users have a corporate firewall so when it checks the link it invalidates it before the User gets to click it.

Seems like some ppl have had success doing that.

---

<div class="post-metadata">

**Author:** ![code-escapee](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/code-escapee/32/195485_2.png) [@code-escapee](https://forum.bubble.io/u/code-escapee)\
**Post date:** [October 17, 2023, 7:34pm UTC](https://forum.bubble.io/t/magic-link-help-logs-when-a-user-enters-an-error-page/286997/4 "2023-10-17T19:34:14Z")

</div>

I’ve gone down this rabbit hole before. It looks s/t like this:

1. Store each magic link request / token
2. Add parameters to the magic link, IDing it as a magic link, whether it was successful or failed and the UID from Step 1.
3. On the page, if the url parameter tells you a magic link was used, update the record created in step 1 (or create a log associated with it) with the full url and success / failure, and timestamp.
4. You can then run a API workflow for all failures to update the failure reason on records from Step 1 by checking if the link was used already or if the link expired. Once this is run any failures that don’t fall into these categories are the issues you’lll want to debug and you’ll have the full url to tell you if the link got messed up somewhere along the way.

---

<div class="post-metadata">

**Author:** ![ramiro](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@ramiro](https://forum.bubble.io/u/ramiro)\
**Post date:** [October 18, 2023, 12:03am UTC](https://forum.bubble.io/t/magic-link-help-logs-when-a-user-enters-an-error-page/286997/5 "2023-10-18T00:03:28Z")

</div>

Yes! have seen that, but the problem persists, they should show what happens behind scenes, it’s very difficult to debug these situations and having to make a fix ton knowing what the problem is is not good at all.

Thank you Tyler!!!

---

<div class="post-metadata">

**Author:** ![code-escapee](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/code-escapee/32/195485_2.png) [@code-escapee](https://forum.bubble.io/u/code-escapee)\
**Post date:** [October 18, 2023, 12:06am UTC](https://forum.bubble.io/t/magic-link-help-logs-when-a-user-enters-an-error-page/286997/6 "2023-10-18T00:06:44Z")

</div>

> [@ramiro](#):
>
> to make a fix ton knowing what the problem is is not good at all.

They sure should but whatcha you gonna do.

---

<div class="post-metadata">

**Author:** ![ramiro](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@ramiro](https://forum.bubble.io/u/ramiro)\
**Post date:** [October 18, 2023, 12:10am UTC](https://forum.bubble.io/t/magic-link-help-logs-when-a-user-enters-an-error-page/286997/7 "2023-10-18T00:10:04Z")

</div>

That’s a good solution! i’m doing something like that without the last step. There is a possible bug where email providers transform the link and the user gets redirected incorrectly (the link received by the user is a sendgrid encoded link).

> [@code-escapee](#):
>
> They sure should but whatcha you gonna do.

Just cry hahaha 😅

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [December 15, 2023, 5:21pm UTC](https://forum.bubble.io/t/magic-link-help-logs-when-a-user-enters-an-error-page/286997/8 "2023-12-15T17:21:42Z")

</div>

Closed on December 15, 2023, 5:21pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
