interface 2 session expirty redirect

This commit is contained in:
Pratham Soni
2024-06-13 11:33:47 -05:00
parent d8faf58b03
commit cdbb45bc34
+4 -1
View File
@@ -1,5 +1,5 @@
import json
import security
import boto3
from langchain.prompts import PromptTemplate
from langchain.embeddings.bedrock import BedrockEmbeddings
@@ -65,6 +65,9 @@ try:
user_mail = st.session_state.user_info['mail']
except KeyError as e:
st.write("Session Expired.")
#st.write("Please sign-in to use this app.")
auth_url = security.get_auth_url(REDIRECT_URI)
st.markdown(f"<a href='{auth_url}' target='_self'>Sign In</a>", unsafe_allow_html=True)
st.stop()
# remove below try except statement if comparison with actual vales is not required