Spaces:
Sleeping
Sleeping
FauziIsyrinApridal
commited on
Commit
·
8f0f2c2
1
Parent(s):
8e56035
..
Browse files- app/auth.py +3 -3
app/auth.py
CHANGED
|
@@ -83,7 +83,7 @@ def auth_view():
|
|
| 83 |
q_type = get_q("type")
|
| 84 |
if q_type == "recovery":
|
| 85 |
st.info("Reset password: silakan masukkan password baru Anda.")
|
| 86 |
-
access_token = get_q("
|
| 87 |
refresh_token = get_q("refresh_token")
|
| 88 |
with st.form("reset_password_form"):
|
| 89 |
npw = st.text_input("Password Baru", type="password")
|
|
@@ -111,7 +111,7 @@ def auth_view():
|
|
| 111 |
<script>
|
| 112 |
(function(){
|
| 113 |
const qp = new URLSearchParams(window.location.search);
|
| 114 |
-
["type","
|
| 115 |
const newUrl = window.location.pathname + (qp.toString()?('?'+qp.toString()):'');
|
| 116 |
window.history.replaceState(null, '', newUrl);
|
| 117 |
})();
|
|
@@ -152,7 +152,7 @@ def auth_view():
|
|
| 152 |
session_obj = getattr(auth_res, "session", None)
|
| 153 |
if session_obj:
|
| 154 |
st.session_state["sb_session"] = {
|
| 155 |
-
"access_token": getattr(session_obj, "
|
| 156 |
"refresh_token": getattr(session_obj, "refresh_token", None),
|
| 157 |
}
|
| 158 |
st.success("Login berhasil")
|
|
|
|
| 83 |
q_type = get_q("type")
|
| 84 |
if q_type == "recovery":
|
| 85 |
st.info("Reset password: silakan masukkan password baru Anda.")
|
| 86 |
+
access_token = get_q("access_token")
|
| 87 |
refresh_token = get_q("refresh_token")
|
| 88 |
with st.form("reset_password_form"):
|
| 89 |
npw = st.text_input("Password Baru", type="password")
|
|
|
|
| 111 |
<script>
|
| 112 |
(function(){
|
| 113 |
const qp = new URLSearchParams(window.location.search);
|
| 114 |
+
["type","access_token","refresh_token","expires_in","expires_at","token_type"].forEach(k=>qp.delete(k));
|
| 115 |
const newUrl = window.location.pathname + (qp.toString()?('?'+qp.toString()):'');
|
| 116 |
window.history.replaceState(null, '', newUrl);
|
| 117 |
})();
|
|
|
|
| 152 |
session_obj = getattr(auth_res, "session", None)
|
| 153 |
if session_obj:
|
| 154 |
st.session_state["sb_session"] = {
|
| 155 |
+
"access_token": getattr(session_obj, "access_token", None),
|
| 156 |
"refresh_token": getattr(session_obj, "refresh_token", None),
|
| 157 |
}
|
| 158 |
st.success("Login berhasil")
|