mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 18:30:41 -06:00
18 lines
638 B
Go
18 lines
638 B
Go
|
package setting
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
type AuthPasswordlessMagicLinkSettings struct {
|
||
|
// Passwordless Auth via Magic Link
|
||
|
Enabled bool
|
||
|
CodeExpiration time.Duration
|
||
|
}
|
||
|
|
||
|
func (cfg *Cfg) readPasswordlessMagicLinkSettings() {
|
||
|
authPasswordless := cfg.SectionWithEnvOverrides("auth.passwordless")
|
||
|
PasswordlessMagicLinkSettings := AuthPasswordlessMagicLinkSettings{}
|
||
|
PasswordlessMagicLinkSettings.Enabled = authPasswordless.Key("enabled").MustBool(false)
|
||
|
PasswordlessMagicLinkSettings.CodeExpiration = authPasswordless.Key("code_expiration").MustDuration(time.Minute * 20)
|
||
|
cfg.PasswordlessMagicLinkAuth = PasswordlessMagicLinkSettings
|
||
|
}
|