Ajout d'un message de connexion réussie

This commit is contained in:
François Pelletier 2024-08-24 10:46:10 -04:00
parent 19953b8429
commit c7e193b912

View file

@ -77,9 +77,13 @@ with tab0:
# Send a POST request to your authentication endpoint
response = requests.post(f'{fabriquedoc_endpoint}/token/', data={"username": username, "password": password})
if response.status_code == 200:
st.write("Connexion réussie!")
bearer_token = response.json()["access_token"]
# Store the bearer token in the session state
st.session_state['bearer_token'] = bearer_token
else:
st.error("Connexion échouée!")
st.session_state['bearer_token'] = ""
with tab1:
def button1_callback():