Spaces:
Sleeping
Sleeping
Commit
·
ce6901f
1
Parent(s):
3e825f9
Login test 2.2
Browse files
app.py
CHANGED
|
@@ -124,18 +124,18 @@ with gr.Blocks(css=css, head=yt_init_js) as main_page:
|
|
| 124 |
current_video_id = gr.Textbox(value=start_video_id, visible=False, interactive=False)
|
| 125 |
selected_row_idx = gr.Number(value=-1, visible=False)
|
| 126 |
|
|
|
|
|
|
|
| 127 |
with gr.Row():
|
| 128 |
with gr.Column(scale=1, min_width=100):
|
| 129 |
-
gr.LoginButton(value="", logout_value="")
|
| 130 |
with gr.Column(scale=4, min_width=400):
|
| 131 |
@gr.render(inputs=current_user)
|
| 132 |
def check_login(logged_in_user):
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
main_page.load(get_username, outputs=current_user) # Disabled when auth is disabled
|
| 139 |
|
| 140 |
with gr.Row():
|
| 141 |
with gr.Column(scale=2, min_width=600):
|
|
|
|
| 124 |
current_video_id = gr.Textbox(value=start_video_id, visible=False, interactive=False)
|
| 125 |
selected_row_idx = gr.Number(value=-1, visible=False)
|
| 126 |
|
| 127 |
+
main_page.load(get_username, outputs=current_user) # Disabled when auth is disabled
|
| 128 |
+
|
| 129 |
with gr.Row():
|
| 130 |
with gr.Column(scale=1, min_width=100):
|
| 131 |
+
gr.LoginButton(value="Log in", logout_value="Log in")
|
| 132 |
with gr.Column(scale=4, min_width=400):
|
| 133 |
@gr.render(inputs=current_user)
|
| 134 |
def check_login(logged_in_user):
|
| 135 |
+
if logged_in_user is None:
|
| 136 |
+
gr.Markdown("## Please log in via Hugging Face")
|
| 137 |
+
else:
|
| 138 |
+
gr.Markdown(f"## Logged in as {user}")
|
|
|
|
|
|
|
| 139 |
|
| 140 |
with gr.Row():
|
| 141 |
with gr.Column(scale=2, min_width=600):
|