Reputation: 434
I'd like to add an authorization header to my httpscallable for calling a firebase function. Currently I use:
const httpsCallable = Firebase.functions.httpsCallable('xxxxx');
httpsCallable(call_args).then(....)
But I'm trying to secure my app need to add auth tokens. How can I add an authorization header with "Bearer: ...."?
The accepted answer on this thread just says "it's possible." Does anyone know how to do it though?
Thanks!
Upvotes: 3
Views: 789
Reputation: 434
Answering my own question. For a logged in user, firebase will automatically include the Authorization header in the form "Authorization:" "Bearer: $token" where token is the result of firebase.auth().currentUser.getIdToken()
Upvotes: 2