We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6cb9aa3 commit 5c86fc6Copy full SHA for 5c86fc6
components/Auth.py
@@ -161,10 +161,20 @@ def get_user():
161
if confirm_button:
162
otp = pyotp.TOTP(mfa_token).verify(mfa_confirm)
163
if otp:
164
- _ = requests.post(
+ response = requests.post(
165
f"{auth_uri}/v1/login",
166
json={"email": st.session_state["email"], "token": mfa_confirm},
167
)
168
+ if response.status_code == 200:
169
+ data = response.json()
170
+ if "detail" in data:
171
+ new_uri = data["detail"]
172
+ if data["detail"].startswith("http"):
173
+ st.markdown(
174
+ f'<meta http-equiv="refresh" content="0;URL={new_uri}">',
175
+ unsafe_allow_html=True,
176
+ )
177
+ st.stop()
178
st.session_state["mfa_confirmed"] = True
179
if "otp_uri" in st.session_state:
180
del st.session_state["otp_uri"]
0 commit comments