This commit is contained in:
DeveloperDurp 2024-09-02 14:08:54 -05:00
parent 73830d57b8
commit b4562a1da4
13 changed files with 89 additions and 130 deletions

View file

@ -3,8 +3,8 @@ package middleware
import (
"context"
"errors"
"github.com/charmbracelet/log"
"gitlab.com/developerdurp/durpify/handlers"
"gitlab.com/developerdurp/durpify/logger"
"net/http"
"strings"
"time"
@ -117,7 +117,7 @@ func (cfg *AuthConfig) validateToken(tokenString string) (*jwt.Token, error) {
options := keyfunc.Options{
Ctx: ctx,
RefreshErrorHandler: func(err error) {
logger.LogError("There was an error with the jwt.Keyfunc" + err.Error())
log.Error("There was an error with the jwt.Keyfunc" + err.Error())
},
RefreshInterval: time.Hour,
RefreshRateLimit: time.Minute * 5,