Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,8 @@ import requests
|
|
4 |
|
5 |
def login_auth(username, password):
|
6 |
|
7 |
-
if username
|
8 |
-
|
9 |
-
return gr.Row(visible=False), gr.Row(visible=True)
|
10 |
-
else:
|
11 |
-
|
12 |
-
return gr.Row(visible=True), gr.Row(visible=False)
|
13 |
|
14 |
with gr.Blocks() as iface:
|
15 |
with gr.Row(visible=False) as app_row:
|
@@ -27,7 +23,7 @@ with gr.Blocks() as iface:
|
|
27 |
username_tbox = gr.Textbox(label="User Name", interactive=True)
|
28 |
password_tbox = gr.Textbox(label="Password", interactive=True, type='password')
|
29 |
submit_btn = gr.Button(value='Submit', variant='primary', size='sm')
|
30 |
-
submit_btn.click(login_auth, inputs=[username_tbox, password_tbox]
|
31 |
with gr.Column(scale=2):
|
32 |
gr.Markdown("")
|
33 |
with gr.Row():
|
|
|
4 |
|
5 |
def login_auth(username, password):
|
6 |
|
7 |
+
if username != password:
|
8 |
+
raise gr.Error("Username not equal to Password")
|
|
|
|
|
|
|
|
|
9 |
|
10 |
with gr.Blocks() as iface:
|
11 |
with gr.Row(visible=False) as app_row:
|
|
|
23 |
username_tbox = gr.Textbox(label="User Name", interactive=True)
|
24 |
password_tbox = gr.Textbox(label="Password", interactive=True, type='password')
|
25 |
submit_btn = gr.Button(value='Submit', variant='primary', size='sm')
|
26 |
+
submit_btn.click(login_auth, inputs=[username_tbox, password_tbox])
|
27 |
with gr.Column(scale=2):
|
28 |
gr.Markdown("")
|
29 |
with gr.Row():
|