Add auth config struct and restructure social auth provider config to enable iteration and adding other providers
This commit is contained in:
parent
3d7011e504
commit
b81e1e482a
2 changed files with 18 additions and 5 deletions
|
@ -3,8 +3,8 @@ package config
|
|||
import (
|
||||
"time"
|
||||
|
||||
"github.com/khlieng/dispatch/storage"
|
||||
"github.com/fsnotify/fsnotify"
|
||||
"github.com/khlieng/dispatch/storage"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
|
@ -18,6 +18,7 @@ type Config struct {
|
|||
Defaults Defaults
|
||||
HTTPS HTTPS
|
||||
LetsEncrypt LetsEncrypt
|
||||
Auth Auth
|
||||
}
|
||||
|
||||
type Defaults struct {
|
||||
|
@ -51,6 +52,18 @@ type LetsEncrypt struct {
|
|||
Email string
|
||||
}
|
||||
|
||||
type Auth struct {
|
||||
Anonymous bool
|
||||
Login bool
|
||||
Registration bool
|
||||
Providers map[string]Provider
|
||||
}
|
||||
|
||||
type Provider struct {
|
||||
Key string
|
||||
Secret string
|
||||
}
|
||||
|
||||
func LoadConfig() (*Config, chan *Config) {
|
||||
viper.SetConfigName("config")
|
||||
viper.AddConfigPath(storage.Path.ConfigRoot())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue