Spaces:
Paused
Paused
update app.py
Browse files
app.py
CHANGED
|
@@ -157,11 +157,14 @@ with gr.Blocks() as interface:
|
|
| 157 |
# Step 1: Provide a link for the user to log in
|
| 158 |
login_link = gr.HTML(f'<a href="{login_url}" target="_blank">Click here to login with Microsoft</a>')
|
| 159 |
|
| 160 |
-
|
| 161 |
-
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
-
# Step 3: Button to handle token exchange after user pastes the authorization code
|
| 164 |
-
login_button = gr.Button("Submit Authorization Code")
|
| 165 |
|
| 166 |
# Handle login button click
|
| 167 |
def handle_login(auth_code):
|
|
@@ -185,10 +188,10 @@ with gr.Blocks() as interface:
|
|
| 185 |
submit_btn = gr.Button("Submit", visible=False)
|
| 186 |
chat_history = gr.Chatbot(label="Chat History", visible=False)
|
| 187 |
|
| 188 |
-
login_button.click(handle_login, inputs=[auth_code_box], outputs=[input_box, submit_btn, chat_history])
|
| 189 |
|
| 190 |
|
| 191 |
# Chat handling
|
| 192 |
submit_btn.click(chat, inputs=[input_box, chat_history], outputs=[chat_history, input_box])
|
| 193 |
|
| 194 |
-
interface.launch()
|
|
|
|
| 157 |
# Step 1: Provide a link for the user to log in
|
| 158 |
login_link = gr.HTML(f'<a href="{login_url}" target="_blank">Click here to login with Microsoft</a>')
|
| 159 |
|
| 160 |
+
driver = webdriver.Firefox()
|
| 161 |
+
url = driver.current_url
|
| 162 |
+
|
| 163 |
+
# # Step 2: Ask the user to paste the authorization code after login
|
| 164 |
+
# auth_code_box = gr.Textbox(label="Authorization Code", placeholder=driver.current_url)
|
| 165 |
|
| 166 |
+
# # Step 3: Button to handle token exchange after user pastes the authorization code
|
| 167 |
+
# login_button = gr.Button("Submit Authorization Code")
|
| 168 |
|
| 169 |
# Handle login button click
|
| 170 |
def handle_login(auth_code):
|
|
|
|
| 188 |
submit_btn = gr.Button("Submit", visible=False)
|
| 189 |
chat_history = gr.Chatbot(label="Chat History", visible=False)
|
| 190 |
|
| 191 |
+
# login_button.click(handle_login, inputs=[auth_code_box], outputs=[input_box, submit_btn, chat_history])
|
| 192 |
|
| 193 |
|
| 194 |
# Chat handling
|
| 195 |
submit_btn.click(chat, inputs=[input_box, chat_history], outputs=[chat_history, input_box])
|
| 196 |
|
| 197 |
+
interface.launch()
|