'Google keeps deleting app password (Rails)

I'm using rails and mailer. Whenever user signs up, the user gets an email confirmation. In the gmail account (business) I've set up 2-step authentication and an app password. The email gets sent well in production (tested by me only) with heroku.

BUT every few weeks the app crashes, because the app password in gmail had somehow mysteriously been deleted. I have to create a new one every time.

I've searched around but I don't see instances where this happens with app password... Do you have any thoughts?



Solution 1:[1]

Once two-factor authentication is enabled, create a application password for heroku and use that password in the service configuration

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Solerman Kaplon