# \[SOLVED\] Restrict access to confirmation page

**URL:** <https://forum.bubble.io/t/solved-restrict-access-to-confirmation-page/5973>\
**Category:** Need help\
**Created:** [September 14, 2016, 1:06pm UTC](https://forum.bubble.io/t/solved-restrict-access-to-confirmation-page/5973 "2016-09-14T13:06:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![cm1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cm1/32/3947_2.png) [@cm1](https://forum.bubble.io/u/cm1)\
**Post date:** [September 14, 2016, 1:06pm UTC](https://forum.bubble.io/t/solved-restrict-access-to-confirmation-page/5973/1 "2016-09-14T13:06:52Z")

</div>

How can i restrict the access to the confirmation page which is opened by clicking the link from the email? This page, [http://noah-watch.com/version-test/confirmation](http://noah-watch.com/version-test/confirmation) should only be available for users who’s link comes from the email received.

I can see that the URL looks like this:  
[http://noah-watch.com/version-test/confirmation?confirmation\_email=1473857091513x794421913567930500](http://noah-watch.com/version-test/confirmation?confirmation_email=1473857091513x794421913567930500)

Any ideas?

Thank you

---

<div class="post-metadata">

**Author:** ![soeren](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/soeren/32/1726_2.png) [@soeren](https://forum.bubble.io/u/soeren)\
**Post date:** [September 14, 2016, 9:07pm UTC](https://forum.bubble.io/t/solved-restrict-access-to-confirmation-page/5973/2 "2016-09-14T21:07:02Z")

</div>

You could run a workflow on page load that checks if the parameter sent to the page in the URL contains a valid ID? I’m not sure what this ID refers to, but it’s probably to a “User” object. So you could do a search for Users with that unique ID and only allow the page to be displayed if the user exists.

---

<div class="post-metadata">

**Author:** ![cm1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cm1/32/3947_2.png) [@cm1](https://forum.bubble.io/u/cm1)\
**Post date:** [September 14, 2016, 9:10pm UTC](https://forum.bubble.io/t/solved-restrict-access-to-confirmation-page/5973/3 "2016-09-14T21:10:24Z")

</div>

Hi Soeren

That was the thing, i didn’t know where does this id belongs to, but could find out if its the user. Then your advice could work 🙂

Thank you

---

<div class="post-metadata">

**Author:** ![cm1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cm1/32/3947_2.png) [@cm1](https://forum.bubble.io/u/cm1)\
**Post date:** [September 14, 2016, 9:24pm UTC](https://forum.bubble.io/t/solved-restrict-access-to-confirmation-page/5973/4 "2016-09-14T21:24:06Z")

</div>

nope, is not the user unique id:  
Maybe @emmanuel can tell us where this id comes from? and how we can work with it?

[http://noah-watch.com/version-test/confirmation?confirmation\_email=1473888013402x937705735908821200](http://noah-watch.com/version-test/confirmation?confirmation_email=1473888013402x937705735908821200)

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [September 14, 2016, 9:38pm UTC](https://forum.bubble.io/t/solved-restrict-access-to-confirmation-page/5973/5 "2016-09-14T21:38:36Z")

</div>

This is what we use to track which user is confirming the email. You shouldn’t do anything with it, that’s a behind the scene thing.

---

<div class="post-metadata">

**Author:** ![cm1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cm1/32/3947_2.png) [@cm1](https://forum.bubble.io/u/cm1)\
**Post date:** [September 14, 2016, 9:44pm UTC](https://forum.bubble.io/t/solved-restrict-access-to-confirmation-page/5973/6 "2016-09-14T21:44:40Z")

</div>

So if you open this link [http://noah-watch.com/version-test/confirmation?confirmation\_email=1473889032425x874554027803242200](http://noah-watch.com/version-test/confirmation?confirmation_email=1473889032425x874554027803242200) and press the button Confirm email, to which user applies this:

 ![](https://us1.discourse-cdn.com/bubble/original/2X/1/1904d122737601e3bdfb087d246573987a11f904.png)

Sholdn’t this page be restricted only to user you accessed it by clicking on the link from email sent to him?

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [September 14, 2016, 9:45pm UTC](https://forum.bubble.io/t/solved-restrict-access-to-confirmation-page/5973/7 "2016-09-14T21:45:24Z")

</div>

It does it automatically for you.

No, because if you pick “home” as the confirmation page, we can’t restrict it.

but feel free to add some events to redirect users.

---

<div class="post-metadata">

**Author:** ![cm1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cm1/32/3947_2.png) [@cm1](https://forum.bubble.io/u/cm1)\
**Post date:** [September 14, 2016, 10:02pm UTC](https://forum.bubble.io/t/solved-restrict-access-to-confirmation-page/5973/8 "2016-09-14T22:02:34Z")

</div>

now i got it. We do not need to create any field under user type. It already exists

 ![](https://us1.discourse-cdn.com/bubble/original/2X/e/ec38f0f514bf8921349d08b3b3daebae98f35a8d.png)

---

<div class="post-metadata">

**Author:** ![gakanimal](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gakanimal/32/12658_2.png) [@gakanimal](https://forum.bubble.io/u/gakanimal)\
**Post date:** [July 12, 2017, 10:37pm UTC](https://forum.bubble.io/t/solved-restrict-access-to-confirmation-page/5973/9 "2017-07-12T22:37:03Z")

</div>

> [@emmanuel](#):
>
> but feel free to add some events to redirect users.

I know it’s been a while but this is still valid and I’ve been testing this out, with a few problems and a workaround.

The email confirmation link from the email goes to a “behind the scenes thing” that confirms the user’s email then redirects to the page specified in the initial action (ie “send confirmation email” in login page for example). So for this example, I created a page “setup” as the redirect page after email confirmation.

Problem is, after bubble updates the “email confirmed” flag on the user and redirects to page “setup”, it takes some time for the “Current User” object to reflect the confirmed email status. And so when the “status” page is loaded and the “Page Loaded” event fires, the flag still says the user’s email is not confirmed.

One solution is to add an event “Do every x seconds…” to trigger your workflow. Put all your steps into a custom event and trigger that when the email confirmed flag on the current user is true. In my test, it was taking between 4 and10 seconds for this to fire.

So I ended up with 3 Workflow events:

1. Custom Event with the steps I want to run when a user confirms their email

2. “Do every 1 second” event with a single action that triggers the custom event only when the current user’s email confirmed flag is true

3. “Page is loaded” event with a 15 second wait time before redirecting back to the login page.

 ![](https://us1.discourse-cdn.com/bubble/original/2X/2/2b0ce6fce246bc48731865cfda91fccea16238d0.png)

Good: If a user goes to page “setup” without using the email link then they cannot acces the app and they can be redirected back to the login page.

Not so good: It’s not immediate, but it does work.

Might be better if the “behind the scenes” action passed the updated Current User as an object to the page, then it could be checked immediately.

Hope it helps? Thoughts?
