continued auth system
This commit is contained in:
@@ -17,6 +17,7 @@ func LoadConfig() (*Config, error) {
|
||||
}
|
||||
// other sources?
|
||||
|
||||
config.def()
|
||||
config.verify()
|
||||
return &config, nil
|
||||
}
|
||||
@@ -24,6 +25,11 @@ func LoadConfig() (*Config, error) {
|
||||
type Config struct {
|
||||
ClientID string
|
||||
RedirectURI string
|
||||
SQliteDB string
|
||||
}
|
||||
|
||||
func (c *Config) def() {
|
||||
c.SQliteDB = "./db.sqlite"
|
||||
}
|
||||
|
||||
func (c *Config) loadEnv() error {
|
||||
@@ -38,6 +44,9 @@ func (c *Config) loadEnv() error {
|
||||
if str, found := os.LookupEnv("REDIR_URI"); found {
|
||||
c.RedirectURI = strings.TrimSpace(str)
|
||||
}
|
||||
if str, found := os.LookupEnv("SQLITE_DB"); found {
|
||||
c.SQliteDB = strings.TrimSpace(str)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user