20 lines
506 B
Go
20 lines
506 B
Go
package validator
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/authelia/authelia/v4/internal/configuration/schema"
|
|
"github.com/authelia/authelia/v4/internal/utils"
|
|
)
|
|
|
|
// ValidateTheme validates and update Theme configuration.
|
|
func ValidateTheme(config *schema.Configuration, validator *schema.StructValidator) {
|
|
if config.Theme == "" {
|
|
config.Theme = "light"
|
|
}
|
|
|
|
if !utils.IsStringInSlice(config.Theme, validThemeNames) {
|
|
validator.Push(fmt.Errorf(errFmtThemeName, strJoinOr(validThemeNames), config.Theme))
|
|
}
|
|
}
|