21 lines
497 B
Python
21 lines
497 B
Python
import os
|
|
from authlib.integrations.starlette_client import OAuth
|
|
from starlette.config import Config
|
|
|
|
# Load config
|
|
config = Config('.env')
|
|
|
|
# Initialize OAuth
|
|
oauth = OAuth(config)
|
|
|
|
# Register Google OAuth
|
|
oauth.register(
|
|
name='google',
|
|
client_id=os.getenv('GOOGLE_CLIENT_ID'),
|
|
client_secret=os.getenv('GOOGLE_CLIENT_SECRET'),
|
|
server_metadata_url='https://accounts.google.com/.well-known/openid-configuration',
|
|
client_kwargs={
|
|
'scope': 'openid email profile'
|
|
}
|
|
)
|