from google_auth_oauthlib.flow import InstalledAppFlow
import json

SCOPES = ['https://www.googleapis.com/auth/drive.file']

flow = InstalledAppFlow.from_client_secrets_file('customer/gdrive/credentials.json', SCOPES)
creds = flow.run_local_server(port=0)

with open('customer/gdrive/token.json', 'w') as token_file:
    token_file.write(creds.to_json())

print("token.json generated successfully!")
