Streamlit has released new authentication features as of >=1.42 (https://docs.streamlit.io/develop/concepts/connections/authentication), which means this library is about to get a WHOLE LOT SIMPLER.
All I have done here is take out most of the authentication parts of the code, and added a few new features like allowing you to choose where the subscription button goes (or if it even exists), adding the entire subscription information from stripe into session state for flexibility, and improving the documentation.
To use this, you basically just need to start using Streamlit login (https://docs.streamlit.io/develop/concepts/connections/authentication), and then use this library to check if they are subscribed to your app.
Please feel free to test this out and tell me what sucks, would love to make it better.