31 lines
625 B
Go
31 lines
625 B
Go
package utils
|
|
|
|
// import (
|
|
// "context"
|
|
// "log"
|
|
// )
|
|
|
|
// func VerifyToken(token string) (*auth.Token, error) {
|
|
// if app == nil {
|
|
// setup()
|
|
// }
|
|
//
|
|
// client, err := app.Auth(context.Background())
|
|
// if err != nil {
|
|
// log.Fatalf("error getting Auth client: %v\n", err)
|
|
// }
|
|
// return client.VerifyIDToken(context.Background(), token)
|
|
// }
|
|
//
|
|
// func setup() {
|
|
// opt := option.WithCredentialsFile("./secrets/firebase.json")
|
|
//
|
|
// firebaseApp, err := firebase.NewApp(context.Background(), nil, opt)
|
|
//
|
|
// if err != nil {
|
|
// log.Fatalf("error initializing app: %v", err)
|
|
// }
|
|
//
|
|
// app = firebaseApp
|
|
// }
|