Explorar o código

fix: add validation for JWT validity duration in new settings (#3564)

Aceix hai 1 mes
pai
achega
755a390003
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      logic/settings.go

+ 3 - 0
logic/settings.go

@@ -46,6 +46,9 @@ func UpsertServerSettings(s models.ServerSettings) error {
 
 func ValidateNewSettings(req models.ServerSettings) bool {
 	// TODO: add checks for different fields
+	if req.JwtValidityDuration > 525600 || req.JwtValidityDuration < 5 {
+		return false
+	}
 	return true
 }