continued auth system

This commit is contained in:
zomo
2025-10-31 12:08:10 -05:00
parent 8355ca374b
commit 5f35823033
8 changed files with 186 additions and 30 deletions

View File

@@ -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
}