feat: Enhance OAuth2 flow with temporary code exchange and update cookie handling
This commit is contained in:
@@ -46,7 +46,6 @@ class Settings(BaseSettings):
|
||||
GOOGLE_CLIENT_SECRET: str = ""
|
||||
GITHUB_CLIENT_ID: str = ""
|
||||
GITHUB_CLIENT_SECRET: str = ""
|
||||
OAUTH_REDIRECT_URL: str = "http://localhost:8001/auth/callback"
|
||||
|
||||
|
||||
settings = Settings()
|
||||
|
||||
@@ -30,8 +30,8 @@ async def get_oauth_service(
|
||||
|
||||
|
||||
async def get_current_user(
|
||||
access_token: Annotated[str | None, Cookie()],
|
||||
auth_service: Annotated[AuthService, Depends(get_auth_service)],
|
||||
access_token: Annotated[str | None, Cookie()] = None,
|
||||
) -> User:
|
||||
"""Get the current authenticated user from JWT token in HTTP-only cookie."""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user