abidlabs HF staff commited on
Commit
5aa55a4
·
1 Parent(s): d6dc1a5
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -34,15 +34,16 @@ def get_user(request: Request):
34
  return user['name']
35
  return None
36
 
37
- # @app.get('/')
38
- # def public(request: Request, user: dict = Depends(get_user)):
39
- # root_url = gr.route_utils.get_root_url(request, "/", None)
40
- # if user:
41
- # return RedirectResponse(url=f"{root_url}/gradio")
42
- # else:
43
- # redirect_url = f"{root_url}/login-demo"
44
- # print("Redirecting to", redirect_url)
45
- # return RedirectResponse(url=redirect_url)
 
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):