Check for default jwt

This commit is contained in:
Daniel Ponte 2024-11-02 17:31:19 -04:00
parent 2922db0db9
commit 160da5b246

View file

@ -63,6 +63,9 @@ func (a *Auth) AuthMiddleware() func(http.Handler) http.Handler {
} }
func (a *Auth) initJWT() { func (a *Auth) initJWT() {
if string(a.cfg.JWTSecret) == "super secret string" {
log.Fatal().Msg("JWT secret is the default!")
}
a.jwt = jwtauth.New("HS256", []byte(a.cfg.JWTSecret), nil) a.jwt = jwtauth.New("HS256", []byte(a.cfg.JWTSecret), nil)
} }