# Change api token lifetime with Actions when user has no valid email

**URL:** <https://community.auth0.com/t/change-api-token-lifetime-with-actions-when-user-has-no-valid-email/117992>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [October 6, 2023, 2:26pm UTC](https://community.auth0.com/t/change-api-token-lifetime-with-actions-when-user-has-no-valid-email/117992 "2023-10-06T14:26:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joao.magalhaes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/joao.magalhaes/32/51486_2.png) [@joao.magalhaes](https://community.auth0.com/u/joao.magalhaes)\
**Post date:** [October 6, 2023, 2:26pm UTC](https://community.auth0.com/t/change-api-token-lifetime-with-actions-when-user-has-no-valid-email/117992/1 "2023-10-06T14:26:28Z")

</div>

I currently only allow the token to be provided whenever a user has a valid email.  
However I would like to change it so that if the email is not yet validated the user could still receive a token but with a very short session.

I currently used actions to deny access to the api, but could I make it so that access is granted but only for x amount of time?

---

<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:** [October 6, 2023, 4:53pm UTC](https://community.auth0.com/t/change-api-token-lifetime-with-actions-when-user-has-no-valid-email/117992/3 "2023-10-06T16:53:57Z")

</div>

Hi @joao.magalhaes,

Welcome to the Auth0 Community!

Unfortunately, it’s not possible to use Actions to grant a user access, but only for a certain amount of time.

For now, changing the API Token Lifetime settings is the only way to manipulate the token’s TTL.

In this case, I recommend changing your token’s expiration to be as short-lived as possible.

Then you can proceed with allowing your users to log in for a short period of time.

Let me also add that I would not advise allowing non-validated email address users to log in, as it could weaken your security posture and introduce fraudulent users.

I hope the explanation was clear!

Please let me know if you have any questions.

Thanks,  
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:** [October 20, 2023, 4:54pm UTC](https://community.auth0.com/t/change-api-token-lifetime-with-actions-when-user-has-no-valid-email/117992/4 "2023-10-20T16:54:34Z")

</div>

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