Python/post-signup-event/README.md
This sample demonstrates how to use an Auth blocking function to save a user's Google OAuth2 access token to Firestore upon sign-up. It then uses a task queue to schedule a Cloud Function that uses this token to create a Google Calendar event for the user.
See file functions/main.py for the code.
The function savegoogletoken is an Auth blocking function that triggers before a user is created. If the user is signing up with Google, it saves their OAuth2 access token to a user_info collection in Firestore. It then creates a task to call the scheduleonboarding function.
The scheduleonboarding function is a task queue function that retrieves the user's access token from Firestore, creates a new event on their primary Google Calendar, and then deletes the access token from Firestore.
savegoogletoken function is triggered by beforeUserCreated Auth blocking event.scheduleonboarding function is triggered by a task queue.To deploy and test the sample:
git clone https://github.com/firebase/functions-samplescd functions-samples/Python/post-signup-eventfirebase use --add and select your Firebase project.firebase deploy.