Abhishek Thakur
commited on
Commit
·
feb1f78
1
Parent(s):
c4b5267
fix redirect uri
Browse files- competitions/oauth.py +1 -2
competitions/oauth.py
CHANGED
@@ -77,9 +77,8 @@ def _add_oauth_routes(app: fastapi.FastAPI) -> None:
|
|
77 |
redirect_uri = request.url_for("auth")
|
78 |
redirect_uri_as_str = str(redirect_uri)
|
79 |
if redirect_uri.netloc.endswith(".hf.space"):
|
80 |
-
# In Space, FastAPI redirect as http but we want https
|
81 |
redirect_uri_as_str = redirect_uri_as_str.replace("http://", "https://")
|
82 |
-
return await oauth.huggingface.authorize_redirect(request,
|
83 |
|
84 |
@app.get("/auth")
|
85 |
async def auth(request: fastapi.Request) -> RedirectResponse:
|
|
|
77 |
redirect_uri = request.url_for("auth")
|
78 |
redirect_uri_as_str = str(redirect_uri)
|
79 |
if redirect_uri.netloc.endswith(".hf.space"):
|
|
|
80 |
redirect_uri_as_str = redirect_uri_as_str.replace("http://", "https://")
|
81 |
+
return await oauth.huggingface.authorize_redirect(request, redirect_uri_as_str) # type: ignore
|
82 |
|
83 |
@app.get("/auth")
|
84 |
async def auth(request: fastapi.Request) -> RedirectResponse:
|