Added config for Firebase key

This commit is contained in:
2024-08-23 21:45:10 +02:00
parent b451da7e8e
commit 365d5a68a1
5 changed files with 25 additions and 17 deletions

View File

@ -8,7 +8,7 @@ import (
)
// tokenIsVerified verifies that a request is authorized. It returns a bool.
func tokenIsVerified(w http.ResponseWriter, r *http.Request) bool {
func tokenIsVerified(w http.ResponseWriter, r *http.Request, c *b.Config) bool {
idToken := r.Header.Get("Authorization")
if idToken == "" {
log.Println("Authorization header missing")
@ -16,7 +16,7 @@ func tokenIsVerified(w http.ResponseWriter, r *http.Request) bool {
return false
}
client, err := b.NewClient()
client, err := b.NewClient(c)
if err != nil {
log.Println(err)
http.Error(w, err.Error(), http.StatusInternalServerError)