Skip to content

Repository files navigation

breaddit

Your daily dose of bread memes.

Sending OAuth token from client to server

This is how you send requests with the firebase jwt token appended in the Authorization header.

asyncfunctionrequest(bool){vartest={'vote': bool};lettoken=awaitfirebase.auth().currentUser.getIdToken();letval=awaitfetch('http://localhost:5001/breaddit-885b4/us-central1/api/karma/comment/-LrzMy3yhYJfR6mefUaN',{method: 'POST',// *GET, POST, PUT, DELETE, etc.headers: {'Content-Type': 'application/json','Authorization': token},body: JSON.stringify(test)}).then((resp)=>resp.text());// Gets raw response. console.log(val);}

About

Your daily dose of bread memes.

Topics

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages