Allow remember be duration to be customized via config
This commit is contained in:
@ -12,9 +12,10 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
HTTP HTTPConfig `yaml:"http"`
|
||||
SMTP SMTPConfig `yaml:"smtp"`
|
||||
Hydra HydraConfig `yaml:"hydra"`
|
||||
HTTP HTTPConfig `yaml:"http"`
|
||||
SMTP SMTPConfig `yaml:"smtp"`
|
||||
Hydra HydraConfig `yaml:"hydra"`
|
||||
Session SessionConfig `yaml:"session"`
|
||||
}
|
||||
|
||||
// NewFromFile retrieves the configuration from the given file
|
||||
@ -67,6 +68,11 @@ type HydraConfig struct {
|
||||
HTTPClientTimeout time.Duration `yaml:"httpClientTimeout" env:"HYDRA_HTTP_CLIENT_TIMEOUT"`
|
||||
}
|
||||
|
||||
type SessionConfig struct {
|
||||
DefaultDuration int `yaml:"defaultDuration" env:"HYDRA_SESSION_DEFAULT_DURATION"`
|
||||
RememberMeDuration int `yaml:"rememberMeDuration" env:"HYDRA_SESSION_REMEMBER_ME_DURATION"`
|
||||
}
|
||||
|
||||
func NewDumpDefault() *Config {
|
||||
config := NewDefault()
|
||||
return config
|
||||
@ -99,6 +105,10 @@ func NewDefault() *Config {
|
||||
FakeSSLTermination: false,
|
||||
HTTPClientTimeout: time.Second * 30, //nolint: gomnb
|
||||
},
|
||||
Session: SessionConfig{
|
||||
DefaultDuration: int((time.Hour * 1).Seconds()), // 1 hour
|
||||
RememberMeDuration: int((time.Hour * 24 * 30).Seconds()), // 30 days
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user