package storage import "strings" func (s *Store) GetTurnstileConfig() TurnstileConfig { s.mu.RLock() defer s.mu.RUnlock() return s.turnstileConfig } func (s *Store) UpdateTurnstileConfig(in TurnstileConfig) error { s.mu.Lock() defer s.mu.Unlock() if strings.TrimSpace(in.SecretKey) == "" { in.SecretKey = s.turnstileConfig.SecretKey } in.SiteKey = strings.TrimSpace(in.SiteKey) if err := s.setConfig("turnstile", in); err != nil { return err } s.turnstileConfig = in return nil } func (s *Store) loadOrCreateTurnstileConfig() error { var cfg TurnstileConfig _, err := s.getConfig("turnstile", &cfg) if err != nil { return err } s.turnstileConfig = cfg return nil }