habulaj commited on
Commit
46760ea
·
verified ·
1 Parent(s): 07443da

Update routes/sendnotifications.py

Browse files
Files changed (1) hide show
  1. routes/sendnotifications.py +4 -2
routes/sendnotifications.py CHANGED
@@ -16,9 +16,11 @@ def get_access_token():
16
  credentials = service_account.Credentials.from_service_account_file(
17
  SERVICE_ACCOUNT_FILE
18
  )
19
- scoped_credentials = credentials.with_scopes(['https://www.googleapis.com/auth/cloud-platform'])
 
 
20
  scoped_credentials.refresh(Request())
21
- return credentials.token
22
 
23
  @router.get("/send-test-notification")
24
  async def send_test_notification():
 
16
  credentials = service_account.Credentials.from_service_account_file(
17
  SERVICE_ACCOUNT_FILE
18
  )
19
+ scoped_credentials = credentials.with_scopes(
20
+ ['https://www.googleapis.com/auth/firebase.messaging']
21
+ )
22
  scoped_credentials.refresh(Request())
23
+ return scoped_credentials.token # CORRETO: use as credenciais com escopo!
24
 
25
  @router.get("/send-test-notification")
26
  async def send_test_notification():