# Source code for the Password Rotation integration

**URL:** <https://community.auth0.com/t/source-code-for-the-password-rotation-integration/134747>\
**Category:** Get Help\
**Tags:** reset-password-prompt-new-experience, login-experience\
**Created:** [May 22, 2024, 4:11pm UTC](https://community.auth0.com/t/source-code-for-the-password-rotation-integration/134747 "2024-05-22T16:11:03Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [May 22, 2024, 9:18pm UTC](https://community.auth0.com/t/source-code-for-the-password-rotation-integration/134747/3 "2024-05-22T21:18:25Z")

</div>

Hi @james.boswell,

Welcome to the Auth0 Community!

To mimic the Password Rotation integration in a Post-login action script, I suggest checking out this in a related community post that answers this:

> [@How to force a user to reset password](https://community.auth0.com/t/how-to-force-a-user-to-reset-password/90558/11):
>
> Hi @tanner.stirrat, Thanks for the update. If you require the password expiration to be applied conditionally, you might need to write a custom post-login action script to handle this scenario. Here’s a sample code you can use to adapt to your use case: exports.onExecutePostLogin = async (event, api) =\> { // Get the user's last password reset timestamp const lastPasswordReset = event.user.last\_password\_reset; // Check if the last password reset timestamp exists if (lastPasswordReset)…

Let me know if you have any questions.

Thanks,  
Rueben

---

_[View the full topic](https://community.auth0.com/t/source-code-for-the-password-rotation-integration/134747)._
