How to Resolve 'Your Account Has Expired' Errors in FusionAuth
-
We are trying to authorize a user, but when attempting to log in using their credentials, we receive the error message: "Your account has expired." Additionally, we are unable to reset the account expiry date through the FusionAuth portal's user page.
How can we extend the user's account expiry date?
-
To update or extend a user’s account expiry date, you can use the FusionAuth User API to modify the expiry field. You can either set a new expiration date or set the field to null to remove the expiry entirely.
Here’s an example of a PATCH request to update this field:
curl --request PATCH \ --url https://local.fusionauth.io/api/user/42661043-9ab8-4bb8-8778-85217aa05086 \ --header 'Authorization: TulwCDDOmOtvXAVTsRUI4LfSWlF-Bd78uTnQhgviMQG9a1a3Qn7emwBn' \ --header 'Content-Type: application/json' \ --header 'X-FusionAuth-TenantId: 30665132-6767-6665-3132-323466613934' \ --data '{ "user": { "expiry": null } }'
Explanation:
Replace the URL, user ID, and tenant ID with your instance's values.
Setting "expiry": null removes the expiration date and reactivates the user account.
This should resolve the issue and allow the user to log in again. -