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