Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
feat: switch to credential file temporary
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed Dec 3, 2019
1 parent 9b2b0fd commit ff21aca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--debug=localhost
.vscode
.env
.firebaserc
.firebaserc
credentials.json
7 changes: 6 additions & 1 deletion firebase/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import (
"encoding/json"
"fmt"
"log"
"os"

firebase "firebase.google.com/go"
"firebase.google.com/go/auth"
s "github.com/bitfield/script"
"google.golang.org/api/option"
)

const firebaseProjectConfig string = "./.firebaserc"
Expand Down Expand Up @@ -56,7 +58,10 @@ func (f *Firebase) InitializeFirbeaseApp(ctx context.Context, projectId string)
ProjectID: f.projectId,
}

app, err := firebase.NewApp(ctx, configs)
// replace this with something better
opt := option.WithCredentialsFile(os.Getenv("firebaseToken"))

app, err := firebase.NewApp(ctx, configs, opt)

if err != nil {
log.Fatalf("error initializing app: %v\n", err)
Expand Down

0 comments on commit ff21aca

Please sign in to comment.