Skip to content

Commit

Permalink
url for now supports URL type
Browse files Browse the repository at this point in the history
  • Loading branch information
nacosdev committed Jun 1, 2023
1 parent 42b1b9b commit d0f224d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions fastapi_middlewares/itutor_google_sso/itutor_google_sso.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def init_routes(
async def google_sso(request: Request, redirect_to: Optional[str] = None):
# absolute url for callback
# we will define it below
redirect_uri = request.url_for("auth")
redirect_uri = str(request.url_for("auth"))
kwargs = {}
if redirect_to:
# Using state to pass the redirect_to url
Expand All @@ -168,7 +168,7 @@ async def google_sso(request: Request, redirect_to: Optional[str] = None):
async def google_sso_login(request: Request, error_message: Optional[str] = None, redirect_to: Optional[str] = None):
# absolute url for callback
# we will define it below
auth_url = request.url_for("google_sso")
auth_url = str(request.url_for("google_sso"))
if redirect_to:
auth_url += f"?{urlencode({'redirect_to': redirect_to})}"
return templates.TemplateResponse(
Expand All @@ -194,7 +194,7 @@ async def auth(request: Request, state: Optional[str] = None):
@app.get(f"{login_base_path}/logout", include_in_schema=False)
async def google_sso_logout(request: Request):
request.session.pop("user", None)
login_url = request.url_for(LOGIN_FUNCTION)
login_url = str(request.url_for(LOGIN_FUNCTION))
return RedirectResponse(url=login_url)
return app

Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

VERSION = '0.0.7'
VERSION = '0.0.8'
DESCRIPTION = 'Package for google sso login in FastAPI'
LONG_DESCRIPTION = 'Package for google sso login in FastAPI'

Expand All @@ -18,11 +18,11 @@
include_package_data = True,
package_data={'fastapi_middlewares': ['statics/*', 'itutor_google_sso/templates/*']},
install_requires=[
"Authlib>=1.0.1",
"httpx>=0.23.0",
"itsdangerous>=2.1.2",
"jinja2>=3.1.1",
"fastapi>=0.75.2",
"Authlib>=1.0.1",
"httpx>=0.23.0",
"itsdangerous>=2.1.2",
"jinja2>=3.1.1",
"fastapi>=0.75.2",
],
url="https://github.com/bcpitutor/fastapi_middlewares",
keywords=['google-sso', 'fastapi'],
Expand Down

0 comments on commit d0f224d

Please sign in to comment.