This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Module for handling authentication, interactions with Firebase and JWT cookies. | |
This solution is refactored from the ‘streamlit_authenticator’ package . It leverages JSON | |
Web Token (JWT) cookies to maintain the user’s login state across browser sessions. For the | |
backend, It uses Google’s Firebase Admin Python SDK. This solution ensures that the content | |
of the page and user settings panel are only displayed if the user is authenticated. Similarly, | |
the login page can only be accessed if the user is not authenticated. Upon registration, the | |
user is sent a verification link to their e-mail address. | |
Important - to make this app run, put the following variables in your secrets.toml file: | |
COOKIE_KEY - a random string key for your passwordless reauthentication |