Copy the code below to your Streamlit app, insert your normal app code in the if statement at the bottom, and run it:
```python
streamlit_app.py
import streamlit as st
def check_password():
    """Returns True if the user had a correct password."""
def password_entered():
    """Checks whether a password entered by the user is correct."""
    if (
        st.session_state["username"] in st.secrets["passwords"]
        and st.session_state["password"]
        == st.secrets["passwords"][st.session_state["username"]]
    ):
        st.session_state["password_correct"] = True
        del st.session_state["password"]  # don't store username + password
        del st.session_state["username"]
    else:
        st.session_state["password_correct"] = False
if "password_correct" not in st.session_state:
