This repository has been archived on 2025-08-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
web-app-template/utils/auth.go
2024-08-24 22:04:13 +02:00

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
// }