Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
changes
Browse files
app.py
CHANGED
@@ -34,15 +34,16 @@ def get_user(request: Request):
|
|
34 |
return user['name']
|
35 |
return None
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
#
|
41 |
-
#
|
42 |
-
#
|
43 |
-
#
|
44 |
-
#
|
45 |
-
#
|
|
|
46 |
|
47 |
@app.route('/logout')
|
48 |
async def logout(request: Request):
|
|
|
34 |
return user['name']
|
35 |
return None
|
36 |
|
37 |
+
@app.get('/')
|
38 |
+
def public(request: Request, user: dict = Depends(get_user)):
|
39 |
+
return RedirectResponse(url='https://abidlabs-gradio-oauth.hf.space/main/')
|
40 |
+
# root_url = gr.route_utils.get_root_url(request, "/", None)
|
41 |
+
# if user:
|
42 |
+
# return RedirectResponse(url=f"{root_url}/gradio")
|
43 |
+
# else:
|
44 |
+
# redirect_url = f"{root_url}/login-demo"
|
45 |
+
# print("Redirecting to", redirect_url)
|
46 |
+
# return RedirectResponse(url=redirect_url)
|
47 |
|
48 |
@app.route('/logout')
|
49 |
async def logout(request: Request):
|