INNER CODE UNIT · Python
get_google_oauth_client
hunvreus/devpush · app/dependencies.py:77
def get_google_oauth_client() -> OAuth:
settings = get_settings()
if not settings.google_client_id or not settings.google_client_secret:
return None
oauth = OAuth()
oauth.register(
"google",
client_id=settings.google_client_id,
client_secret=settings.google_client_secret,
server_metadata_url="https://accounts.google.com/.well-known/openid-configuration",
client_kwargs={"scope": "openid email profile"},
)
return oauth
async def get_google_user_info(oauth_client: OAuth, token: dict) -> dict | None:
"""Get user info from Google."""