func (auth *Authenticator) StopGC() {
	close(auth.GC)
}
StopGC stops the garbage collector task, in case you want to stop it but
leave the application active.
package jwtauth
import (
	"context"
	"crypto/rsa"
	"fmt"
	"net/http"
	"strconv"
	"time"
	"github.com/lestrrat/go-jwx/jwa"
	"github.com/lestrrat/go-jwx/jwe"
	"github.com/lestrrat/go-jwx/jwt"
	"github.com/lpar/serial"
)
type Authenticator struct {
	CookieName     string         
	CookieLifespan time.Duration  
	ContextName    string         
	LoginURL       string         
	PrivateKey     *rsa.PrivateKey
	SerialGen      *serial.Generator
	GC             chan struct{}  
}
const defaultCookieName = "token"
const defaultCookieLifespan = time.Hour / 3
const defaultContextName = "jwtauth"
const defaultLoginURL = "/login"
func NewAuthenticator(rsakey *rsa.PrivateKey) *Authenticator {
	auth := &Authenticator{
		CookieName:     defaultCookieName,
		CookieLifespan: defaultCookieLifespan,
		ContextName:    defaultContextName,
		LoginURL:       defaultLoginURL,
		SerialGen:      serial.NewGenerator(),
		PrivateKey:     rsakey,
	}
	return auth
}
func (auth *Authenticator) StartGC() {
	auth.GC = auth.NewGarbageCollector()
}