diff --git a/cloud-functions/python/functions/clearusers.py b/cloud-functions/python/functions/clearusers.py index ef915d4..5ad88f1 100644 --- a/cloud-functions/python/functions/clearusers.py +++ b/cloud-functions/python/functions/clearusers.py @@ -15,6 +15,20 @@ def clear_users(request): Response object using `make_response` . """ + if request.method == 'OPTIONS': + headers = { + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Methods': 'GET', + 'Access-Control-Allow-Headers': 'Content-Type', + # 'Access-Control-Max-Age': '3600' + } + + return ('', 204, headers) + + headers = { + 'Access-Control-Allow-Origin': '*' + } + key_path = os.getcwd() + '/hpos-preprod-firebase-adminsdk-d6jjt-ae42ad0f67.json' cred = credentials.Certificate(key_path) firebase_admin.initialize_app(cred)