# Add 'accept terms and conditions' - store acceptance in user\_metadata

**URL:** <https://community.auth0.com/t/add-accept-terms-and-conditions-store-acceptance-in-user-metadata/131038>\
**Category:** Get Help\
**Tags:** login-prompt-new-experience, login-experience\
**Created:** [April 2, 2024, 8:16pm UTC](https://community.auth0.com/t/add-accept-terms-and-conditions-store-acceptance-in-user-metadata/131038 "2024-04-02T20:16:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![noelt.dolan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/noelt.dolan/32/60288_2.png) [@noelt.dolan](https://community.auth0.com/u/noelt.dolan)\
**Post date:** [April 2, 2024, 8:16pm UTC](https://community.auth0.com/t/add-accept-terms-and-conditions-store-acceptance-in-user-metadata/131038/1 "2024-04-02T20:16:32Z")

</div>

Hi,

As part of login process, is there a documented way to show a ‘terms and conditions’ page with an ‘accept’ checkbox or button, which can then be stored in the user\_metadata?

I have tried just adding to middleware to check if user has accepted terms by setting a property in user\_metadata, then redirecting to terms-condition page if necessary. However from that, though I ‘think’ I can make an PATCH API call to api/v2/users/:id endpoint to update the user, I then shall have the problem that the session info doesn’t contain the new accepted terms status. (is there a way I can refresh the session with the new value without logging out/in again or am I completely off track in my approach?)

For reference, I’m using typescript/nextjs if relevant.

Thank you in advance

Noel

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [April 2, 2024, 11:33pm UTC](https://community.auth0.com/t/add-accept-terms-and-conditions-store-acceptance-in-user-metadata/131038/3 "2024-04-02T23:33:08Z")

</div>

Hi @noelt.dolan,

Yes, this is possible with Auth0 Redirect Actions. You can redirect your users to an external page where you gather their consent and store it in the user’s user\_metadata.

You can also selectively trigger this based on some criteria, such as, their login count, like during their first time logging in.

You can append the user’s user\_metadata as a custom claim after the redirect has completed and this way that information can be retrieved during the same session flow.

Here is a reference using Rules. You will have to convert it to an Action:  
[https://community.auth0.com/t/how-do-i-add-terms-and-conditions-using-rules/87153](https://community.auth0.com/t/how-do-i-add-terms-and-conditions-using-rules/87153)

Let me know how this goes for you.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![noelt.dolan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/noelt.dolan/32/60288_2.png) [@noelt.dolan](https://community.auth0.com/u/noelt.dolan)\
**Post date:** [April 4, 2024, 1:13pm UTC](https://community.auth0.com/t/add-accept-terms-and-conditions-store-acceptance-in-user-metadata/131038/4 "2024-04-04T13:13:27Z")

</div>

> [@rueben.tiow](#):
>
> Rueben

Thanks Rueben, your suggestion worked well. Just one minor annoyance though with user event.secrets in the custom actions, I can’t ‘see’ what the values are that I’ve set each key. Could you add a show/hide option which is very common on other platforms?

Noel

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [April 5, 2024, 8:12pm UTC](https://community.auth0.com/t/add-accept-terms-and-conditions-store-acceptance-in-user-metadata/131038/5 "2024-04-05T20:12:18Z")

</div>

Hi @noelt.dolan,

Great to hear that the solution worked well for you!

Generally, you can include a `console.log(event.secrets.KEY)` in your script, press the test button, and see the value you have set for your secrets.

If you would like to see an option to show/hide these secrets, I recommend creating a [feedback request](https://community.auth0.com/c/feedback/95) asking for this feature.

Cheers,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 19, 2024, 8:12pm UTC](https://community.auth0.com/t/add-accept-terms-and-conditions-store-acceptance-in-user-metadata/131038/6 "2024-04-19T20:12:45Z")

</div>

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