func isTokenExpired(token *firebase.FirestoreAppleDevJWT) bool {
	logger.Log("IsTokenExpired", "Starting...")
	var currentTime = time.Now()
	logger.Log("IsTokenExpired", fmt.Sprintf("Issued At: %d seconds", token.IssuedAt))
	logger.Log("IsTokenExpired", fmt.Sprintf("Expires At: %d seconds\n", token.ExpiresAt))
	if currentTime.After(time.Unix(token.ExpiresAt, 0)) {
		logger.Log("IsTokenExpired", "Token is expired. Need to generate a new one.")
		return true
	}
	logger.Log("IsTokenExpired", "Token is not expired.")
	return false
}
isTokenExpired will check to see if the Apple Developer Token is expired
package createappledevtoken
import (
	"context"
	"crypto/x509"
	"encoding/pem"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"time"
	"cloud.google.com/go/firestore"
	"github.com/dgrijalva/jwt-go"
	"github.com/pixelogicdev/gruveebackend/pkg/firebase"
	"github.com/pixelogicdev/gruveebackend/pkg/sawmill"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)
func initWithEnv() error {
	if os.Getenv("ENVIRONMENT") == "DEV" {
		currentProject = os.Getenv("FIREBASE_PROJECTID_DEV")
		applePrivateKeyPath = os.Getenv("APPLE_PRIVATE_KEY_PATH_DEV")
	} else if os.Getenv("ENVIRONMENT") == "PROD" {
		currentProject = os.Getenv("FIREBASE_PROJECTID_PROD")
		applePrivateKeyPath = os.Getenv("APPLE_PRIVATE_KEY_PATH_PROD")
	}
	client, err := firestore.NewClient(context.Background(), currentProject)
	if err != nil {
		return fmt.Errorf("CreateAppleDevToken [Init Firestore]: %v", err)
	}
	sawmillLogger, err := sawmill.InitClient(currentProject, os.Getenv("GCLOUD_CONFIG"), os.Getenv("ENVIRONMENT"), "CreateAppleDevToken")
	if err != nil {
		log.Printf("CreateAppleDevToken [Init Sawmill]: %v", err)
	}
	firestoreClient = client
	logger = sawmillLogger
	return nil
}
func fetchToken() (*firebase.FirestoreAppleDevJWT, error) {
	logger.Log("FetchToken", "Starting...")
	snapshot, snapshotErr := firestoreClient.Collection("internal_tokens").Doc("appleDevToken").Get(context.Background())
	if status.Code(snapshotErr) == codes.NotFound {
		logger.Log("FetchToken", "AppleDevToken not found in DB. Need to create.")
		return nil, nil
	}
	if snapshotErr != nil {
		return nil, fmt.Errorf(snapshotErr.Error())
	}
	logger.Log("FetchToken", "Snapshot found.")
	var appleDevToken firebase.FirestoreAppleDevJWT
	dataToErr := snapshot.DataTo(&appleDevToken)
	if dataToErr != nil {
		return nil, fmt.Errorf(dataToErr.Error())
	}
	logger.Log("FetchToken", "Decoded AppleDevToken successfully.")
	return &appleDevToken, nil
}