# Check grant/token type in Login Action

**URL:** <https://community.auth0.com/t/check-grant-token-type-in-login-action/71018>\
**Category:** Get Help\
**Tags:** login\
**Created:** [October 8, 2021, 2:55pm UTC](https://community.auth0.com/t/check-grant-token-type-in-login-action/71018 "2021-10-08T14:55:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FullStackFool](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/fullstackfool/32/25823_2.png) [@FullStackFool](https://community.auth0.com/u/FullStackFool)\
**Post date:** [October 8, 2021, 2:55pm UTC](https://community.auth0.com/t/check-grant-token-type-in-login-action/71018/1 "2021-10-08T14:55:18Z")

</div>

When writing a custom Login action how do you check what the grant/token type is?

For example the action is triggered on both id\_token requests AND access\_token requests, but the actions you wish to take in the script may differ between the two.

Thanks!

---

<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 8, 2021, 4:43pm UTC](https://community.auth0.com/t/check-grant-token-type-in-login-action/71018/3 "2021-10-08T16:43:32Z")

</div>

Hi @FullStackFool,

Thanks for reaching out to the Auth0 Community!

I understand that you’d like to write custom logic for your Post-Login Action depending on the token type.

To do so, you can write custom logic conditionally for the API object to make changes to the `api.idToken` and `api.accessToken` properties.

You can learn more about the Post-Login Action Event and API Objects in our documentation below:

- [https://auth0.com/docs/actions/triggers/post-login/api-object](https://auth0.com/docs/actions/triggers/post-login/api-object)
- [https://auth0.com/docs/actions/triggers/post-login/event-object](https://auth0.com/docs/actions/triggers/post-login/event-object)

Hoped this helps! Please let me know if you have any questions.

Thank you.

---

<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:** [December 6, 2021, 10:59pm UTC](https://community.auth0.com/t/check-grant-token-type-in-login-action/71018/4 "2021-12-06T22:59:21Z")

</div>

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