Skip to content

Commit

Permalink
redirect fi
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekkrthakur committed Apr 25, 2024
1 parent d5586d3 commit 60f4f05
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/autotrain/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ async def auth(request: fastapi.Request) -> RedirectResponse:

request.session["oauth_info"] = oauth_info
return _redirect_to_target(request)
request.session["oauth_info"] = oauth_info
return _redirect_to_target(request)


def _generate_redirect_uri(request: fastapi.Request) -> str:
Expand All @@ -118,6 +116,6 @@ def _generate_redirect_uri(request: fastapi.Request) -> str:


def _redirect_to_target(request: fastapi.Request, default_target: str = "/") -> RedirectResponse:
# target = request.query_params.get("_target_url", default_target)
target = "https://huggingface.co/spaces/" + os.environ.get("SPACE_ID")
target = request.query_params.get("_target_url", default_target)
# target = "https://huggingface.co/spaces/" + os.environ.get("SPACE_ID")
return RedirectResponse(target)

0 comments on commit 60f4f05

Please sign in to comment.