Skip to content
8 changes: 4 additions & 4 deletions kinde_fastapi/framework/fastapi_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ def _register_kinde_routes(self) -> None:
"""
# Helper function to get current user
async def get_current_user(request: Request):
if not self._oauth.is_authenticated(request):
if not self._oauth.is_authenticated():
return None
try:
return self._oauth.get_user_info(request)
return self._oauth.get_user_info()
except ValueError:
return None

Expand Down Expand Up @@ -229,9 +229,9 @@ async def register(request: Request):
@self.app.get("/user")
async def get_user(request: Request):
"""Get the current user's information."""
if not self._oauth.is_authenticated(request):
if not self._oauth.is_authenticated():
return RedirectResponse(url=await self._oauth.login())
return self._oauth.get_user_info(request)
return self._oauth.get_user_info()

def can_auto_detect(self) -> bool:
"""
Expand Down
4 changes: 2 additions & 2 deletions kinde_flask/framework/flask_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def register():
def get_user():
"""Get the current user's information."""
try:
if not self._oauth.is_authenticated(request):
if not self._oauth.is_authenticated():
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
try:
Expand All @@ -246,7 +246,7 @@ def get_user():
finally:
loop.close()

return self._oauth.get_user_info(request)
return self._oauth.get_user_info()
except Exception as e:
return f"Failed to get user info: {str(e)}", 400

Expand Down
6 changes: 0 additions & 6 deletions kinde_sdk/auth/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ def is_authenticated(self) -> bool:
"""
Check if the user is authenticated using the session manager.

Args:
request (Optional[Any]): The current request object

Returns:
bool: True if the user is authenticated, False otherwise
"""
Expand All @@ -148,9 +145,6 @@ def get_user_info(self) -> Dict[str, Any]:
"""
Get the user information from the session.

Args:
request (Optional[Any]): The current request object

Returns:
Dict[str, Any]: The user information

Expand Down